Hi Renaud,
You do a:
- BEGIN EXCLUSIVE
- INSERT many times, preferably using a precompiled statement
- COMMIT (or ROLLBACK)
This is extremely fast. I'm inserting 7000 records in less than a second
into my database table.
Olaf
----- Original Message -----
From: "Renaud HUILLET" <[EMAIL PROTECTED]>
To: <sqlite-users@sqlite.org>
Sent: Sunday, October 21, 2007 11:18
Subject: RE: [sqlite] Detecting duplicate insert in bulk insert
Hello,
Probably basic question, but I do not see it in the doc :(
How do you insert in bulk ? Is it like in Oracle when you use arrays ?
If so, can you do the same for select statements ?
Or do you just mean you do it all in one transaction ?
Cheers
Renaud
From: [EMAIL PROTECTED]
To: sqlite-users@sqlite.org
Date: Sun, 21 Oct 2007 02:31:05 +0200
Subject: [sqlite] Detecting duplicate insert in bulk insert
Hi,
I'm using a precompiled insert statement in a single transaction to
perform a bulk insert into a database table. I have a UNIQUE constraint on
the same table to prevent duplicate inserts and this works well. However,
I also want to detect and count the duplicate inserts, but when I insert a
duplicate row the error code that is returned from the sqlite_step()
function is SQLITE_ERROR and not SQLITE_CONTRAINT as I would expect. I'm
therefore unable to detect whether the source of the error was from a
duplicate insert or some other error.
How can I detect the duplicate insert?
Regards, Olaf
_________________________________________________________________
Invite your mail contacts to join your friends list with Windows Live
Spaces. It's easy!
http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us
-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------