On Thu, Jun 7, 2018, 9:25 PM Rowan Worth <row...@dug.com> wrote: > On 3 June 2018 at 07:28, Scott Robison <sc...@casaderobison.com> wrote: > > > I've encountered a feature that I think would be awesome: > > https://www.postgresql.org/docs/9.3/static/dml-returning.html > > > > Example: INSERT INTO blah (this, that, another) VALUES (x, y, z) > RETURNING > > id; > > > > > > my thoughts are just that this could greatly simplify a lot of sql > > code that currently has to prepare and execute at least two statements > > to accomplish what is conceptually an atomic task. > > > > For most use cases you only need a single query: > > if (sqlite3_exec(db, "INSERT INTO blah (this, that, another) VALUES (x, > y, z)") == SQLITE_OK) { > long id = sqlite3_last_insert_rowid(db); > ... > }
Fair enough. My statement was intended as a SQL only solution that is independent of the language bindings in use. _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users