[Default] On Sun, 28 Oct 2007 10:00:52 +0100, "Michael Ruck" <[EMAIL PROTECTED]> wrote:
>Hi, > >I did specify UNIQUE for category. The id is also kept, so everything is >working >*except* that I don't get the id of the record ignored from >sqlite3_last_insert_rowid(). > >Mike You could simply do a SELECT id FROM categories WHERE category = '<yourvalue>'; to retrieve the id. After the (ignored) INSERT the database pages with the relevant parts of the BTree for the UNIQUE index on category will still be in memory, so the SELECT will be fast. For even more speed you can prepare the SELECT statement during the init of your program, and bind to the appropriate values every time you need it, so it doesn't have to be parsed every time. Regards, -- ( Kees Nuyt ) c[_] ----------------------------------------------------------------------------- To unsubscribe, send email to [EMAIL PROTECTED] -----------------------------------------------------------------------------