Home » SQL & PL/SQL » SQL & PL/SQL » Drop Column
Drop Column [message #223391] Thu, 08 March 2007 14:18 Go to next message
SUSAN1
Messages: 36
Registered: March 2007
Member
hi,
why I get this error:

SQL> ALTER TABLE MOVIE_AUDIO_TRACK
2 DROP COLUMN "COMMENT";
ALTER TABLE MOVIE_AUDIO_TRACK
*
ERROR at line 1:
ORA-12988: cannot drop column from table owned by SYS


and when I try to drop the column as SYS, I get this error:

SQL> ALTER TABLE SYS.MOVIE_AUDIO_TRACK
2 DROP COLUMN SYS."COMMENT";
DROP COLUMN SYS."COMMENT"
*
ERROR at line 2:
ORA-01748: only simple column names allowed here


can you please tell me what should I do?
regards/Susan
Re: Drop Column [message #223396 is a reply to message #223391] Thu, 08 March 2007 14:50 Go to previous messageGo to next message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
Do you really want SYS to own this table anyway. You should move the table out of the SYS schema and avoid using Oracle's keywords ("COMMENT") as column names.

[Updated on: Thu, 08 March 2007 15:20]

Report message to a moderator

Re: Drop Column [message #223397 is a reply to message #223396] Thu, 08 March 2007 14:55 Go to previous messageGo to next message
SUSAN1
Messages: 36
Registered: March 2007
Member
hi,
if I move the table out of sys, should I have new loggin password and username?
I log in as Sys coz I have a free version av Oracle and only way that I could log in was as SYSDBA.
regards/Susan
Re: Drop Column [message #223398 is a reply to message #223397] Thu, 08 March 2007 15:00 Go to previous messageGo to next message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
You'll need to create a new user and then login as SYS and move the table. Then you can log in as the new user and perform your practice activities.

If you are starting out, it may help to go thru 2 Day DBA.
Re: Drop Column [message #223399 is a reply to message #223398] Thu, 08 March 2007 15:04 Go to previous messageGo to next message
SUSAN1
Messages: 36
Registered: March 2007
Member
you mean I have to registred as a new user for Oracle?
Re: Drop Column [message #223400 is a reply to message #223399] Thu, 08 March 2007 15:09 Go to previous messageGo to next message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
You only have to register for OTN (Oracle Technology Network). It's a free service and provides access to the online Oracle documentation.
Re: Drop Column [message #223401 is a reply to message #223400] Thu, 08 March 2007 15:13 Go to previous messageGo to next message
SUSAN1
Messages: 36
Registered: March 2007
Member
Sorry, but I am very new in all this, what happend with my allready database?

maybe I am confiused, but may I asked you tell me more clear what should I do and where should I do, with out doing something wrong with the allready database that I created and working with?
reagards/Susan
Re: Drop Column [message #223404 is a reply to message #223401] Thu, 08 March 2007 15:34 Go to previous messageGo to next message
Littlefoot
Messages: 20901
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
There's probably nothing wrong with the database (yet), but you are about to break it if you continue to mess up with the SYS schema. Until you spend some time and read a book Brian suggested a few posts ago, you'll just wander through Oracle mist.

Create another user and create your tables in its schema. Leave SYS alone.
Re: Drop Column [message #223405 is a reply to message #223404] Thu, 08 March 2007 15:38 Go to previous messageGo to next message
SUSAN1
Messages: 36
Registered: March 2007
Member
my question is how can I create another user?
sorry if I am asking silly question.
Re: Drop Column [message #223407 is a reply to message #223405] Thu, 08 March 2007 15:48 Go to previous messageGo to next message
Littlefoot
Messages: 20901
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Your question isn't silly, but something else is: why do you refuse to read documentation?

User can easily be created:
CREATE USER another_user IDENTIFIED BY its_password;
But that's not enough. This is a blind and deaf user - can't connect to the database, can't create tables, can do NOTHING. It requires certain privileges before you can use it.

Do take some time and read the book. Some things will probably be much more clear to you.
Re: Drop Column [message #223408 is a reply to message #223405] Thu, 08 March 2007 15:48 Go to previous messageGo to next message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
The documentation contains the required syntax (CREATE USER).
Re: Drop Column [message #223409 is a reply to message #223408] Thu, 08 March 2007 15:56 Go to previous messageGo to next message
SUSAN1
Messages: 36
Registered: March 2007
Member
thank you,
I will do that, why I am not do it now, becoz I am solving some assigment for the cours I am on it and the dead line is very soon.

but I will read the book, and I am very thanksfull for your help, I hope you answer my question in the future.
regards/Susan
Re: Drop Column [message #223410 is a reply to message #223409] Thu, 08 March 2007 16:04 Go to previous messageGo to next message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
Well welcome to the forum.
Re: Drop Column [message #223411 is a reply to message #223410] Thu, 08 March 2007 16:05 Go to previous message
SUSAN1
Messages: 36
Registered: March 2007
Member
Thank you,
Previous Topic: To Calculate Prime Numbers in a range between 1 and 100 and insert it into a table
Next Topic: sql for date(formate)
Goto Forum:
  


Current Time: Fri Dec 09 00:00:55 CST 2016

Total time taken to generate the page: 0.14736 seconds