CREATE Table gives ORA-00904 error 
June 2nd, 2009, 04:39 PM
| | Member | | Join Date: Feb 2009 Location: Jersey
Posts: 35
| | - CREATE TABLE "CADBOWNER"."LOGIN"(
-
"USERID" VARCHAR2 (9 BYTE),
-
"FIRSTNAME" VARCHAR2 (20 BYTE),
-
"SURNAME" VARCHAR2 (20 BYTE),
-
"PHONENO" VARCHAR2 (50 BYTE),
-
"EMAIL" VARCHAR2 (50 BYTE),
-
"TRANSIT" VARCHAR2 (50 BYTE),
-
"ACCESSLEVEL" VARCHAR2 (1 BYTE),
-
"GRANTACCESS" VARCHAR2 (1 BYTE),
-
"CREATEDBY" VARCHAR2 (15 BYTE),
-
"DATEUPDATED" DATE,
-
PRIMARY KEY(USERID),
-
)
-
GO
-
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
| 
June 3rd, 2009, 07:26 AM
|  | 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
| 
June 3rd, 2009, 02:10 PM
|  | 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.
| 
June 3rd, 2009, 04:12 PM
| | Member | | Join Date: Feb 2009 Location: Jersey
Posts: 35
| | | re: CREATE Table gives ORA-00904 error - CREATE OR REPLACE TABLE "CADBOWNER"."LOGIN"
-
(
-
"USERID" VARCHAR2,
-
"FIRSTNAME" VARCHAR2,
-
"SURNAME" VARCHAR2,
-
"PHONENO" VARCHAR2,
-
"EMAIL" VARCHAR2,
-
"TRANSIT" VARCHAR2,
-
"ACCESSLEVEL" VARCHAR2,
-
"GRANTACCESS" VARCHAR2,
-
"CREATEDBY" VARCHAR2,
-
"DATEUPDATED" DATE
-
)
-
-
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
| 
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)
| 
June 4th, 2009, 12:23 PM
|  | 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.
|  | | | | /bytes/about
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 225,662 network members.
|