Page 1 of 1

Multiple queries in one transaction

Posted: 02.01.2007, 13:43
by maciejkaczkowski
Is possible to put few inserts and updates in one transaction. SQLite code looks like this:

Code: Select all

with Query.SQL do
begin
  Add('INSERT INTO abc VALUES (''aa'');');
  Add('INSERT INTO abc VALUES (''bb'');');
  Add('INSERT INTO abc VALUES (''cc'');');
  Add('COMMIT;');
end;
Query.ExecSQL;
The same code doesn't work at FB (1.5/2.0). What I should change?

Posted: 04.01.2007, 22:37
by zippo
I think it can be done via a special component called ZSequence or ZProcessor (can't remember and didn't used it until now).

Posted: 05.01.2007, 04:42
by bangfauzan
zippo is right, as far as I know, we can make multiple statements using ZProcessor or ZSequence, but we can't do that using ZQuery.

Posted: 05.01.2007, 09:37
by mdaems
It's ZSqlProcessor.
ZSequence is for getting sequences from the server (eg using nextval() for Oracle)

Mark

Posted: 06.01.2007, 12:27
by maciejkaczkowski
:thanks:
Now everything works fine.