"Shane Harrelson" <[EMAIL PROTECTED]> wrote:
> when i try to insert a row into a table that has a UNIQUE constraint
> on a column, and I get the SQLITE_CONSTRAINT result code because i'm
> inserting a duplicate value, is there anyway to determine the rowid of
> the conflict?
> 
> looking at the internals of the VDBE, i found that the rowid of the
> conflicting row is pushed on top of the VDBE stack.
> 
> if i'm willing to violate the interface, i can dereference the rowid
> from the internals of the VDBE struct.  i'd rather not do this... is
> there a more formal mechanism for getting this value without having do
> to do a separate "select" query?  something like
> sqlite3_last_insert_rowid() -- ie.  sqlite3_last_conflict_rowid()?
> 

The official way to find the conflicting entry is to do a query.

   SELECT rowid FROM table WHERE uniquecolumn=?;

--
D. Richard Hipp  <[EMAIL PROTECTED]>


-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to