On Fri, Jan 04, 2013 at 10:55:43AM +0100, Krzysztof scratched on the wall:
> Hi,
> 
> When I use INSERT OR IGNORE, if insertion fail (record exists),
> then sqlite3_last_insert_rowid does return nothing. Is exists similar
> solution which:
> 1. If insert success then return new rowid
> 2. If insert fail (record exists) then return rowid of existing record
> 
> Can I get this information in one command?

  No.  Mainly because your assumption that one and only one row is
  responsible for triggering the IGNORE conflict resolution is
  incorrect.  For example, if a table has two or more UNIQUE indexes,
  the IGNORE resolution may be triggered by different rows through each
  index.  

   -j

-- 
Jay A. Kreibich < J A Y  @  K R E I B I.C H >

"Intelligence is like underwear: it is important that you have it,
 but showing it to the wrong people has the tendency to make them
 feel uncomfortable." -- Angela Johnson
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to