Re: [pysqlite] About one in a thousand inserts fail!
AK <[email protected]>
| Newsgroups | gmane.comp.python.db.pysqlite.user |
|---|---|
| Message-ID | <[email protected]> |
Gerhard Haering wrote: > On Mon, 24 Mar 2008 12:15:07 -0500, AK <[email protected]> wrote: > >> Hello, I'm using pysqlite for the program listed in my sig. I was >> testing for possible performance issues when the number of records is >> very large (I wanted to test 100k at least), and I ran into this >> problem: sometimes inserts would not actually insert the record in the >> db. No error would be given and program continues normally. >> >> Now, there's probably a better way to do this, but I needed to get the >> last inserted id and it seems sqlite does not have last_id command, [...] >> > > Sure there is. Use the lastrowid property of the cursor object. My guess is that then all your inserts can be verified to work ;-) > > -- Gerhard > Thanks for the answer, Gerhard, but why would that happen? That just doesn't make sense to me, I'm sure lastrowid will fix it, but just for future knowledge, because it seems to me that select of ids should have worked just as well, if slower? I'm rather new to sql so there must be something very obvious I'm missing.. thanks, and pysqlite is great otherwise, as is sqlite. -ak > _______________________________________________ > list-pysqlite mailing list > list-pysqlite-FR6EJeJVuqdwc357pe9rcyQmJico6nz3epZhswDD4dQ@public.gmane.org > http://itsystementwicklung.de/cgi-bin/mailman/listinfo/list-pysqlite > > -- -ak Tobu | http://www.lightbird.net/tobu/ | Freeform DB / Tagger / PIM