ORA-00911: invalid character

练习jdbc的时候,创建表报错:

ORA-00911: invalid character的解决办法

 

原来sql:

String sql ="CREATE TABLE INC_YM_TEST_ONE(" +
    "TEST_ONE_ID NUMBER(8) not null," +
    "TEST_ONE_NAME VARCHAR2(50)," +
    "constraint PK_INC_YM_TEST_ONE primary key (TEST_ONE_ID)"+
    ");";

 

解决:将';'去掉!

改为:

String sql ="CREATE TABLE INC_YM_TEST_ONE(" +
    "TEST_ONE_ID NUMBER(8) not null," +
    "TEST_ONE_NAME VARCHAR2(50)," +
    "constraint PK_INC_YM_TEST_ONE primary key (TEST_ONE_ID)"+
    ")
";

ok!~!

你可能感兴趣的:(sql,jdbc)