On 3/4/07, Christian Werner <[EMAIL PROTECTED]> wrote:
Dan Kennedy wrote:
>
> On Sat, 2007-03-03 at 19:18 -0500, Mitchell Vincent wrote:
> > I found the nifty ODBC driver for SQLite and have been trying to use
> > it to replace a 2.8 SQlite implementation in some desktop software.
> > It's working very well except for a rather large problem of not being
> > able to call the last_id API functions. I need to get the primary keys
> > assigned to parent tables in order to preserve referential integrity.
> >
> > SELECT MAX(id) FROM TABLE is one option but it's pretty dangerous
> > seeing as multipl people *could* be accessing this database file at
> > the same time..
>
> What if you wrap the INSERT and "SELECT MAX(id)" statements together
> in a transaction?

Or what about issuing a "SELECT last_insert_rowid()" ?


As long as it was inside a transaction (and that works), that's the
ticket! Thanks!

--
- Mitchell Vincent
- K Software - Innovative Software Solutions
- Visit our website and check out our great software!
- http://www.ksoftware.net

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to