oldeast Active Member Licensed User Longtime User Oct 26, 2012 #1 Hi, I have db with a 2 related one to many tables.:sign0104: When the user adds a record in the main table I want to recover the ID of the saved record for insertion into the related table foreign key. I am using the dbutils, (thanks!:sign0142 but not sure how to retrieve the record ID just entered.. Many thanks
Hi, I have db with a 2 related one to many tables.:sign0104: When the user adds a record in the main table I want to recover the ID of the saved record for insertion into the related table foreign key. I am using the dbutils, (thanks!:sign0142 but not sure how to retrieve the record ID just entered.. Many thanks
K keirS Well-Known Member Licensed User Longtime User Oct 26, 2012 #2 You can do it as a query "select last_insert_rowid()" returns the rowid of the last record added to the database. Upvote 0
You can do it as a query "select last_insert_rowid()" returns the rowid of the last record added to the database.
oldeast Active Member Licensed User Longtime User Oct 26, 2012 #3 Thanks... Thanks, will check out the sqllite documentation more carefully next time.:signOops: Upvote 0