![]() I think that is a much smaller imposition on users than adding further syntax complexity. If the DMLR feature (which is experimental and evolving) should produce results that can be put into a temp table or used directly in queries, you could easily write that simple query using those RETURNING results. Maybe a different syntax like would be better?Ī simple query would get the set of rowid you desire. length( X ) For a string value X, the length(X) function returns the number of characters (not bytes) in X prior to the first NUL character. q | sqlite3m -batch -cmd ".read dmlr_conflict.sql"Īs you can see, the last DMLR input produced an empty result set. Executes a statement that returns the row id of the last row inserted by the statement. The lastinsertrowid() SQL function is a wrapper around the sqlite3lastinsertrowid() C/C++ interface function. EVIDENCE-OF: R-36596-35603 The sqlite3lastinsertrowid (D) interface usually returns the rowid of the most recent successful INSERT into a. ![]() Insert into t values ('dog') on conflict do nothing returning rowid, species The sqlite3lastinsertrowid (D) interface usually returns the rowid of the most recent successful INSERT into a rowid table or virtual table on database connection D. Insert into t values ('pig') on conflict do nothing returning rowid, species The pre-v3.35 build I have acts that way. In my opinion, DMLR which yields only data modification attempts should not return anything. We might discuss what happens now, and how desirable that or something else is. The problem I have with this is that it returns the. If the parameter is an array or a collection, it should return long or List instead.If the Insert method receives only 1 parameter, it can return a long, which is the new rowId for the inserted item. However, the DML with a RETURNING clause ("DMLR") is in development and so it is premature to ask what happens, as if that was the final answer. According to the documentation functions annoted with Insert can return the rowId. I would expect no returned result from attempting data modification where it cannot occur. Is the rowid returned if there was already an entry? INSERT INTO my_table(foo) VALUES (?) ON CONFLICT DO NOTHING RETURNING rowid INSERT OR IGNORE INTO my_table(foo) VALUES (?) RETURNING rowid
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |