0

When I try to execute the SQL statment below in Oracle SQL Developer:

CREATE TABLE Nrom1Tab ( Sig TEXT NOT NULL PRIMARY KEY, 
   DocSubject TEXT,  
   DocClassification TEXT,  
   DepName VARCHAR, 
   OrgName TEXT,  
   FromInf  TEXT,   
   ToInf TEXT,    
   DateInf TEXT, 
   NoteInf TEXT );

It shows this error:

enter image description here

4 Answers 4

5

I'm not sure what the error message is, however

  1. TEXT is not a valid data type in Oracle.
  2. VARCHAR is a valid data type but you would need to specify the length (i.e. VARCHAR(10)) would allow up to 10 bytes of storage (assuming a default NLS_LENGTH_SEMANTICS of BYTE). It would generally be preferred to use the VARCHAR2 data type rather than VARCHAR as well.
Sign up to request clarification or add additional context in comments.

Comments

2

I believe the error complaining about missing a left parenthesis, is angry that VARCHAR doesn't have a length defined. The error references column 113, which would be where the left parenthesis should be, the 114th character on that line.

Justin also correctly points out TEXT is not a valid datatype. While I don't think that is causing the error you're seeing, it'll be an error very soon :)

Comments

1

I believe you have to give VARCHAR an amount like VARCHAR(50).

Comments

1
CREATE TABLE Nrom1Tab 
( 
    Sig TEXT PRIMARY KEY, DocSubject TEXT,  DocClassification TEXT,  
    DepName VARCHAR(100), -- Missing LENGTH
    OrgName TEXT,  FromInf  TEXT,   ToInf TEXT,   DateInf TEXT, NoteInf TEXT );

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.