当我使用flutter和创建表时,我得到以下错误!:
error DatabaseException(incomplete input (code 1 SQLITE_ERROR): , while compiling: CREATE TABLE scheduled_shift_groups(id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT, uniqueGroupId TEXT, nightShiftCount INTEGER, dayShiftCount INTEGER, weekEnding INTEGER, estimatedIncome REAL) sql 'CREATE TABLE scheduled_shift_groups(id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT, uniqueGroupId TEXT, nightShiftCount INTEGER, dayShiftCount INTEGER, weekEnding INTEGER, estimatedIncome REAL' args []} during open, closing...
下面是我的代码:
Future<Database> database = getDatabasesPath().then((String path) {
return openDatabase(
join(path, dbName),
onCreate: (Database db, int version) async {
await db.execute(
"CREATE TABLE $scheduledShiftGroupsTableName(id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT, uniqueGroupId TEXT, nightShiftCount INTEGER, dayShiftCount INTEGER, weekEnding INTEGER, estimatedIncome REAL");
},
version: 1,
);
});
1条答案
按热度按时间kgsdhlau1#
其实我犯了个愚蠢的错误!!!在execute方法中,我忘记了
REAL
后面的)
符号。现在问题解决了)。编码快乐!