9

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,
    );
  });

1 Answer 1

24

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

Now Problem solved). Happy coding!

Sign up to request clarification or add additional context in comments.

4 Comments

Thanks for mentioning it. You saved some important hours.
Seriously... I wonder I made same mistake
crazily simple error which wastes hours;)
life saverrrrrrrrrrrrrr.....:)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.