ORA-00906: missing left parenthesis

后端 未结 2 1582
我寻月下人不归
我寻月下人不归 2021-01-11 16:44
create table widep(
 cac NUMBER,
 ddate DATE,
 dtime TIMESTAMP,
 type VARCHAR2,
 amount NUMBER(10,2),
 constraint qwe foreign key(cac) references cust(cac)
)
         


        
相关标签:
2条回答
  • 2021-01-11 17:18

    The complete error message states Error at CommandLine:5 Column:15 which is this location:

    type VARCHAR2,
                ^^^
    

    VARCHAR2 requires a size parameter to define the maximum number of characters. Use something like

    create table widep(
     cac NUMBER,
     ddate DATE,
     dtime TIMESTAMP,
     type VARCHAR2(100),
     amount NUMBER(10,2),
     constraint qwe foreign key(cac) references cust(cac)
    );
    
    0 讨论(0)
  • 2021-01-11 17:29

    CREATE TABLE widep(
    cac NUMBER(10,2) not null,
    date DATE,
    dtime TIMESTAMP,
    type VARCHAR2(50),
    amount NUMBER(10,2),
    CONSTRAINT cac_fk FOREIGN KEY key(cac) REFERENCES cust(cac)
    );
    

    0 讨论(0)
提交回复
热议问题