Connecting Tech Pros Worldwide Help | Site Map

CREATE Table gives ORA-00904 error

Member
 
Join Date: Feb 2009
Location: Jersey
Posts: 35
#1: Jun 2 '09
Expand|Select|Wrap|Line Numbers
  1. CREATE TABLE "CADBOWNER"."LOGIN"(
  2. "USERID" VARCHAR2 (9 BYTE),
  3. "FIRSTNAME" VARCHAR2 (20 BYTE),
  4. "SURNAME" VARCHAR2 (20 BYTE),
  5. "PHONENO" VARCHAR2 (50 BYTE),
  6. "EMAIL" VARCHAR2 (50 BYTE),
  7. "TRANSIT" VARCHAR2 (50 BYTE),
  8. "ACCESSLEVEL" VARCHAR2 (1 BYTE),
  9. "GRANTACCESS" VARCHAR2 (1 BYTE),
  10. "CREATEDBY" VARCHAR2 (15 BYTE),
  11. "DATEUPDATED" DATE,
  12. PRIMARY KEY(USERID),
  13. )
  14. GO
  15.  
Can anyone see what's wrong with this Oracle CREATE TABLE statement which gives me the above error. I also have this error whenever I use the 'New Table' wizard.

Is it possible that the reason I'm getting this error is because I don't have permissions to add a table to the database I'm working with. I do know that I am prohibited from adding a tablespace.

Thanks for your help
Matt
QVeen72's Avatar
Moderator
 
Join Date: Oct 2006
Location: Bangalore
Posts: 1,385
#2: Jun 3 '09

re: CREATE Table gives ORA-00904 error


Hi,

You have an Extra Comma After the UserID.. Remove that..
Also note the Primary key constraint..
Check here

Regards
Veena
debasisdas's Avatar
Moderator
 
Join Date: Dec 2006
Location: Bangalore ,India
Posts: 7,497
#3: Jun 3 '09

re: CREATE Table gives ORA-00904 error


Why are you using all the double quotes and what is that GO in your code.
Member
 
Join Date: Feb 2009
Location: Jersey
Posts: 35
#4: Jun 3 '09

re: CREATE Table gives ORA-00904 error


Expand|Select|Wrap|Line Numbers
  1. CREATE OR REPLACE TABLE "CADBOWNER"."LOGIN"
  2. (
  3. "USERID" VARCHAR2, 
  4. "FIRSTNAME" VARCHAR2, 
  5. "SURNAME" VARCHAR2, 
  6. "PHONENO" VARCHAR2, 
  7. "EMAIL" VARCHAR2, 
  8. "TRANSIT" VARCHAR2, 
  9. "ACCESSLEVEL" VARCHAR2, 
  10. "GRANTACCESS" VARCHAR2, 
  11. "CREATEDBY" VARCHAR2, 
  12. "DATEUPDATED" DATE
  13. )
  14.  
  15. GO 
OK, I tried using the info in that link to help but still no luck.

I get a 'missing or invalid option' error, both with and without brackets.
Can anyone help with this simple problem as I need it to create user security for my application!

The 'GO' has been taken from a previous SQL Server script and I believe is superfluous for Oracle.

Cheers
Matt
Newbie
 
Join Date: Dec 2008
Posts: 9
#5: Jun 3 '09

re: CREATE Table gives ORA-00904 error


I think you should give Sizes for your VARCHAR2 columns ....
e.g. VARCHAR2(30)
debasisdas's Avatar
Moderator
 
Join Date: Dec 2006
Location: Bangalore ,India
Posts: 7,497
#6: Jun 4 '09

re: CREATE Table gives ORA-00904 error


Specify size of varchar2 field.
Reply