On 26 Apr 2017, at 9:42pm, Joseph L. Casale <[email protected]> wrote:

> Whats the trick with SQLites working set to format a single statement with 
> parameters
> where if a row exists for a given criteria, returns its Id, otherwise insert 
> and return the
> last_insert_rowid()?

It has to be two operations.

INSERT OR IGNORE INTO MyTable …;
SELECT rowid FROM MyTable WHERE …;

Simon.
_______________________________________________
sqlite-users mailing list
[email protected]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to