Home » SQL & PL/SQL » SQL & PL/SQL » Cannot create table??
Cannot create table?? [message #214031] Sat, 13 January 2007 16:37 Go to next message
nvidia
Messages: 5
Registered: January 2007
Junior Member
Hi i am trying to create a table called 'ITEM'. I have not populated it as of yet. The code so far is:
-- Creation of Item Table
DROP TABLE ITEM CASCADE CONSTRAINTS;
CREATE TABLE ITEM(
ITEMID  NUMBER (6)      NOT NULL,



);


My error message is :
SQL> @table.sql
DROP TABLE ITEM CASCADE CONSTRAINTS
           *
ERROR at line 1:
ORA-00942: table or view does not exist


Input truncated to 2 characters
unknown command ")" - rest of line ignored.


Can som1 help me please?? I'm confused
Re: Cannot create table?? [message #214034 is a reply to message #214031] Sat, 13 January 2007 17:00 Go to previous messageGo to next message
BlackSwan
Messages: 25033
Registered: January 2009
Location: SoCal
Senior Member
visit http://asktom.oracle.com for many fine coding examples
Re: Cannot create table?? [message #214045 is a reply to message #214034] Sun, 14 January 2007 00:06 Go to previous message
Littlefoot
Messages: 20888
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
No wonder you didn't populate the table; how could you, if it doesn't exist?

Now about your messages: first one is understandable - you are trying to DROP a table which does not exist. OK, never mind that.

Second one: what was open, must be closed. In this case, it is about parenthesis. CREATE TABLE statement contains a comma (,) after NOT NULL which indicates that you are about to add another column, but there isn't any. Also, empty lines are not allowed. So, if you modify it like the following, I believe you'll have your table:
CREATE TABLE ITEM
(  ITEMID NUMBER (6) NOT NULL );
Previous Topic: HELP - Cursor, Table Variable, and Update
Next Topic: About Column Names
Goto Forum:
  


Current Time: Fri Dec 02 20:47:45 CST 2016

Total time taken to generate the page: 0.28261 seconds