In Perfect-SQLite lastInsertRowId is truncated to Int. In SQLite it's int64: sqlite3_int64 sqlite3_last_insert_rowid(sqlite3*);