On 8/3/05, Khamis Abuelkomboz <[EMAIL PROTECTED]> wrote:
> Hi
> 
> I'm using SQLite in my application and am very excited about this little
> and fast database.
> 
> How can I retrieve the last created autoincrement value?
> On MySQL and SQLServer or just the SQL standard I can fire the following
> select statement:
> SELECT @@IDENTITY

Actually, as far as I know, SELECT @@IDENTITY isn't part of any ANSI
SQL standard. It cerrtainly won't work on Oracle ;)

That said, you can get the identity value of an autoincremented key
with sqlite3_last_insert_rowid
(http://sqlite.org/capi3ref.html#sqlite3_last_insert_rowid). It's
something of a cheat, but it works and works very well.

-austin
-- 
Austin Ziegler * [EMAIL PROTECTED]
               * Alternate: [EMAIL PROTECTED]

Reply via email to