gpt4 book ai didi

android.database.sqlite.SQLiteException : near "(": syntax error (code 1):

转载 作者:行者123 更新时间:2023-11-29 04:39:20 25 4
gpt4 key购买 nike

我想在数据库中创建表,但我得到了SQLiteException:

这是我创建表的 SQL 请求:

String SQL_CREATE_TEMP_CATALOG_CAR_TABLE  = "CREATE TABLE temp_dn_catalog_car (\n"+
" catalog_car_id INTEGER PRIMARY KEY AUTOINCREMENT(11) NOT NULL, \n"+
" model_id INTEGER KEY(11) NOT NULL, \n"+
" generation_id INTEGER KEY(11) NOT NULL, \n"+
" body_type_id INTEGER KEY(11) NOT NULL, \n"+
" modification_id INTEGER KEY(11) NOT NULL, \n"+
" begin_year INTEGER(11) NOT NULL, \n"+
" end_year INTEGER(11) NOT NULL);\n";

错误代码:

android.database.sqlite.SQLiteException: near "(": syntax error (code 1): , while compiling: CREATE TABLE temp_dn_catalog_car (  catalog_car_id INTEGER PRIMARY KEY AUTOINCREMENT(11) NOT NULL,   model_id INTEGER KEY(11) NOT NULL,   generation_id INTEGER KEY(11) NOT NULL,   body_type_id INTEGER KEY(11) NOT NULL,   modification_id INTEGER KEY(11) NOT NULL,   begin_year INTEGER(11) NOT NULL,   end_year INTEGER(11) NOT NULL);

最佳答案

String SQL_CREATE_TEMP_CATALOG_CAR_TABLE  = "CREATE TABLE temp_dn_catalog_car (+
" catalog_car_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, +
" model_id INTEGER KEY(11) NOT NULL, +
" generation_id INTEGER KEY(11) NOT NULL, +
" body_type_id INTEGER KEY(11) NOT NULL, +
" modification_id INTEGER KEY(11) NOT NULL, +
" begin_year INTEGER(11) NOT NULL, +
" end_year INTEGER(11) NOT NULL); ";

关于android.database.sqlite.SQLiteException : near "(": syntax error (code 1):,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33171454/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com