Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DatabaseException(incomplete input (code 1 SQLITE_ERROR) in Flutter

Tags:

sqlite

flutter

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,
    );
  });
like image 564
Khamidjon Khamidov Avatar asked Oct 18 '20 14:10

Khamidjon Khamidov


Video Answer


1 Answers

Actually, I made a stupid mistake!!! in the execute method I forgot ) sign after REAL.

Now Problem solved). Happy coding!

like image 200
Khamidjon Khamidov Avatar answered Oct 19 '22 06:10

Khamidjon Khamidov