DatabaseException(incomplete input (code 1 SQLITE_ERROR) in Flutter
1,843
Actually, I made a stupid mistake!!! in the execute method I forgot )
sign after REAL
.
Now Problem solved). Happy coding!
Author by
Khamidjon Khamidov
Loves Coding. Problem Solver, Android and Flutter Developer, Linux enthusiast
Updated on December 25, 2022Comments
-
Khamidjon Khamidov over 1 year
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, ); });