-4
CREATE TABLE USERMASTER
(
    UserId NVARCHAR(30) NOT NULL PRIMARY KEY,
    UserPwd NVARCHAR(30) NOT NULL,
    UserName NVARCHAR(50),
    UserPosition NVARCHAR(30),
    UserAccessRights NVARCHAR(30),
    UserStatus integer(10),
    CreateDate DATETIME,
    CreateUserId NVARCHAR(30),
    UopdateDate DATETIME,
    UpdateUserId NVARCHAR(30)    
);

where is the error occur? I try to user toad to create and ist throw me the error:ORA-00907: missing right parenthesis for every single first line.

Lst Patrick
  • 123
  • 6
  • 19

1 Answers1

1

Use

UserStatus integer 

instead of

UserStatus integer(10),

and change datetime to date or if you want time also use timestamp

SQL> CREATE TABLE USERMASTER
  2  (
  3      UserId nvarchar2(30)  PRIMARY KEY,
  4      UserPwd nvarchar2(30) NOT NULL,
  5      UserName nvarchar2(50),
  6      UserPosition nvarchar2(30),
  7      UserAccessRights nvarchar2(30),
  8      UserStatus integer,
  9      CreateDate timestamp,
 10      CreateUserId nvarchar2(30),
 11      UopdateDate timestamp,
 12      UpdateUserId nvarchar2(30)
 13  );

Table created.
anudeepks
  • 1,080
  • 1
  • 12
  • 23
  • solved.. thanks.. but may I know why NVARCHAR and DATETIME cannot be use? – Lst Patrick Apr 22 '15 at 02:20
  • you can use nvarchar, the table above is created with nvarchar only, but cannot use datetime because oracle doesnt support datetime as a valid datatype, you can use either, " Date" or " Timestamp" – anudeepks Apr 22 '15 at 02:24
  • Ic, may i know what is the main causes for this error? coz I change the other query same as the format(nvarchar2 and timestamp) u posted but its throw me the same error.? – Lst Patrick Apr 22 '15 at 02:34
  • The main problem is the `INTEGER(10)`. You can't specify scale or precision with INTEGER, only with NUMBER. Also, DATETIME is not a datatype in Oracle - use either DATE (which contains both date and time information) or TIMESTAMP (which can handle fractional seconds). – Bob Jarvis - Слава Україні Apr 22 '15 at 02:39