Re: [pysqlite] About one in a thousand inserts fail!

Gerhard Haering <[email protected]>
Newsgroups gmane.comp.python.db.pysqlite.user
Message-ID <9696c2bbf2a2acee9f8a5f4a3f7bed3d@localhost>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.