Confusing error about missing left parenthesis in SQL statement

前端 未结 4 845
心在旅途
心在旅途 2021-01-03 23:57

SQLPLUS says I have missing left parenthesis with this statement in my sql script..

CREATE TABLE people(
    id INT NOT NULL PRIMARY KEY,
    name VARCHAR2
)         


        
4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-04 00:37

    VARCHAR2 is a type that needs a maximum size/length. Try something like...

    varchar2(50)
    

    Your missing left parenthesis is the parenthesis that surrounds the size.

    CREATE TABLE people(
        id INT NOT NULL PRIMARY KEY,
        name VARCHAR2(50) 
    );
    

提交回复
热议问题