If the insert() was called from your own code, you could save the return
value.
Otherwise, use db.rawQuery("SELECT last_insert_rowid()", null), and get
the value from the cursor.
-- Kostya
23.02.2011 21:29, ΠΑΣΧΑΛΗΣ ΠΛΙΑΧΑΣ пишет:
Yes but, if i understood well that i read, this procedure is used to
insert an new row in the table. I don't have problem with this. i want
to use the "SELECTlast_insert_rowid()" string to get the last row id
inserted in any table in database.
2011/2/23 Kostya Vasilyev <[email protected] <mailto:[email protected]>>
See this:
http://developer.android.com/reference/android/database/sqlite/SQLiteDatabase.html#insert(java.lang.String
<http://developer.android.com/reference/android/database/sqlite/SQLiteDatabase.html#insert%28java.lang.String>,
java.lang.String, android.content.ContentValues)
Returns
the row ID of the newly inserted row, or -1 if an error occurred
Same with ContentProvider, except you get back a Uri for the new item.
-- Kostya
23.02.2011 21:16, ΠΑΣΧΑΛΗΣ ΠΛΙΑΧΑΣ пишет:
How to use "SELECTlast_insert_rowid()" in
android environment?
Thanks in advance
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to
[email protected]
<mailto:[email protected]>
To unsubscribe from this group, send email to
[email protected]
<mailto:[email protected]>
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--
Kostya Vasilyev --http://kmansoft.wordpress.com
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to
[email protected]
<mailto:[email protected]>
To unsubscribe from this group, send email to
[email protected]
<mailto:android-developers%[email protected]>
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--
Kostya Vasilyev -- http://kmansoft.wordpress.com
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en