简体   繁体   中英

SQL statement error in Oracle SQL Developer

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:

在此处输入图片说明

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 (ie 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.

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 :)

我相信您必须给VARCHAR像VARCHAR(50)这样的金额。

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 );

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM