Connecting Tech Pros Worldwide Help | Site Map

CREATE Table gives ORA-00904 error

  #1  
Old June 2nd, 2009, 04:39 PM
Member
 
Join Date: Feb 2009
Location: Jersey
Posts: 35
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
  #2  
Old June 3rd, 2009, 07:26 AM
QVeen72's Avatar
Moderator
 
Join Date: Oct 2006
Location: Bangalore
Posts: 1,384

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
  #3  
Old June 3rd, 2009, 02:10 PM
debasisdas's Avatar
Moderator
 
Join Date: Dec 2006
Location: Bangalore ,India
Posts: 7,485
Provided Answers: 1

re: CREATE Table gives ORA-00904 error


Why are you using all the double quotes and what is that GO in your code.
  #4  
Old June 3rd, 2009, 04:12 PM
Member
 
Join Date: Feb 2009
Location: Jersey
Posts: 35

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
  #5  
Old June 3rd, 2009, 08:31 PM
Newbie
 
Join Date: Dec 2008
Posts: 9

re: CREATE Table gives ORA-00904 error


I think you should give Sizes for your VARCHAR2 columns ....
e.g. VARCHAR2(30)
  #6  
Old June 4th, 2009, 12:23 PM
debasisdas's Avatar
Moderator
 
Join Date: Dec 2006
Location: Bangalore ,India
Posts: 7,485
Provided Answers: 1

re: CREATE Table gives ORA-00904 error


Specify size of varchar2 field.
Reply


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: help!ORA-01445: cannot select ROWID from a join view without a key-preserved table kaapie answers 0 June 27th, 2008 07:33 PM
global temporary table --> invalid ROWID? Corrine answers 4 June 27th, 2008 06:19 PM
Create Table Error -- Help Please Victor M answers 2 June 27th, 2008 05:52 PM
Flashback over database link Lothar Armbr?ster answers 1 July 19th, 2005 11:21 PM
global temporary table --> invalid ROWID? Corrine answers 4 July 19th, 2005 10:11 PM