Aha!

So 2 possible solutions:
1/ If an error occurs in my "EndTransition();" I should submit "commit;" to 'sqlite'.
2/ I should write each insert in a separated line with sqlite_exec (excluding begin/commits)




Thx Richard!

At 13:32 14/03/2004, you wrote:
Steven Van Ingelgem wrote:
I have a database (duh :p)... There are a few things inside... Now I add a row:
10:33:59: Transition: 'BEGIN ON CONFLICT FAIL;
INSERT INTO Address (CustomerID, Name1, Name2, Name3, Address, ZIP, City, CountryCode, Phone, Fax, Remark) VALUES ('1',
'1', '', '', '1', '1000', '1', 'B ', '',
'', '');commit;
'
--> .... columns are duplicate (that's normal because the data is already in there & the index are set on each field).
Then I redo the exact same insert:
10:34:00: Transition: 'BEGIN ON CONFLICT FAIL;
INSERT INTO Address (CustomerID, Name1, Name2, Name3, Address, ZIP, City, CountryCode, Phone, Fax, Remark) VALUES ('1',
'1', '', '', '1', '1000', '1', 'B ', '',
'', '');commit;
'
--> "Cannot start a transaction within a transaction"
Ok, I do understand that you can't start a transaction in another transaction, but as far as I know I did open & close it only once for each query, right?
My best guess is that somewhere the transaction isn't closed (internally)...

When the first INSERT failed, execution of the SQL stopped. So the first COMMIT never occurred. So the first transaction was still active when you tried to start the second one.


-- D. Richard Hipp -- [EMAIL PROTECTED] -- 704.948.4565


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]


G00fy, (aka KaReL, aka Steven)

Main Webpage : http://komma.cjb.net
CQ Database  : http://lid.fragland.net/
ICQ #        : 35217584

Reply via email to