Thanks Puneet,

Yes, it does seem to work.  I just finished testing that.
I'm determining the new index value for an autoincrement primary key to 
that I can refer to it via other tables.

Vance

P Kishor wrote:

>On Mon, Feb 9, 2009 at 9:44 AM, Vance E. Neff <ven...@intouchmi.com> wrote:
>  
>
>>Can I do the
>>
>>select last_insert_rowid();
>>
>>to determine the new index value
>>After the COMMIT command?
>>    
>>
>
>Yes, but I am not sure what you mean by the "new index value"... keep
>in mind, the last_insert_rowid() returns, well, the last inserted
>rowid.
>
>
>
>  
>
>>Vance
>>
>>
>>
>>
>>Igor Tandetnik wrote:
>>
>>    
>>
>>>Vance E. Neff <ven...@intouchmi.com> wrote:
>>>
>>>
>>>      
>>>
>>>>Just to be straight, I would use the Query:
>>>>SELECT last_insert_rowid() AS TheNewKeyValue FROM TableX
>>>>
>>>>
>>>>        
>>>>
>>>No, you would just do
>>>
>>>select last_insert_rowid();
>>>
>>>Or you could call sqlite3_last_insert_rowid() API directly.
>>>
>>>Last inserted ROWID is the property of a connection, not of a table.
>>>
>>>Igor Tandetnik
>>>
>>>
>>>      
>>>
>
>
>
>  
>

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to