私はGoogleの歯車(Sqliteを)でテーブルを作成しました:Javascript関数とDBクエリツールでlast_insert_row()を使用した場合の違いは?
db.execute('create table if not exists SPALINKS (link_id int PRIMARY KEY, sid1 int, sid2 int, label text, user text, Timestamp int');
(FF)でGoogleのGearsのデータベースクエリツールを使用する場合は、 '最後の挿入-ROWID' で作業罰金を挿入します。 Javascriptのインサートは、「last-insert-rowid」を使用しない限り、うまく動作します。しかし、「最後の挿入-ROWIDを」を使用する場合、それはもう動作しません:
var sql_stmt = 'INSERT INTO SPALINKS (link_id, sid1, sid2, label, user, Timestamp) VALUES (last_insert_rowid(),?,?,?,?,?)';
var arg_array = [sid1, sid2, label, user, creation_time];
db.execute(sql_stmt, arg_array);
Error: Database operation failed. ERROR: constraint failed DETAILS: constraint failed
なぜではなく、作成されたSQL文では、DBツールでのSQLiteの「最後の挿入-ROWIDの仕事の罰金を行いますJavascript関数の内部から実行されますか?