--- Reinhold Venzl-Schubert <[EMAIL PROTECTED]> wrote: > Hi! > > I'm looking for a simple way to get the integer > primery key of a new > record (row) in a table that is created > automatically by SQLite. > > I store text and images in different tables and the > primery key of > the text-record (row) is the reference to find the > corresponding > images in the image-table. > > When I select a text-record (row) it is easy to get > the primery key. > But when I just created a new text-record (row) I > don't know the > primery key to store the images. > > Is there any easy way, or do I have to store the new > text first, > select the new text then again to get the primery > key and after all > to use the primery key to store the images? > > Thanks > Reinhold >
Hi Reinhold, Since you're working in single-user modus, you don't need to worry about record insterions by multiple users; so if your primary key is just an auto-incrementing integer field, you may as well issue a query "SELECT MAX(text_Id) FROM Text" after inserting the Text record, and then use that in your Image insert command. Jan Schenkel. Quartam Reports & PDF Library for Revolution <http://www.quartam.com> ===== "As we grow older, we grow both wiser and more foolish at the same time." (La Rochefoucauld) _______________________________________________ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution