When I am using flutter and creating table, I get the following error! :
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...
Here is my code:
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,
);
});
Actually, I made a stupid mistake!!! in the execute method I forgot )
sign after REAL
.
Now Problem solved). Happy coding!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With