Subject | Re: [ib-support] Regarding Transactions |
---|---|
Author | Ann W. Harrison |
Post date | 2002-04-04T21:14:39Z |
At 05:41 PM 4/4/2002 -0300, Federico Tello Gentile wrote:
InterBase and Firebird handle stored procedures and triggers
differently from client input. One of the requirements of
the SQL standard is that a statement be "atomic", that all
its changes must succeed or fail. Thus the statement
update employees set salary = salary - 10000;
will either change all salaries or none. If the statement
fails, it undoes all its changes. If on the other hand,
you updated the employee records one by one like this
update employees set salary = salary - 10000
where emp_id = 1;
update employees set salary = salary - 10000
where emp_id = 2;
...
update employees set salary = salary - 10000
where emp_id = 10;
only the one record that violated a constraint - or failed
for some other reason - would be removed.
A stored procedure or trigger is activated as part of a user
statement. For that reason, it succeeds or fails as a unit -
give or take error handling. Other databases treat stored
procedures like groups of statements. To each his gout..
Regards,
Ann
www.ibphoenix.com
We have answers.
InterBase and Firebird handle stored procedures and triggers
differently from client input. One of the requirements of
the SQL standard is that a statement be "atomic", that all
its changes must succeed or fail. Thus the statement
update employees set salary = salary - 10000;
will either change all salaries or none. If the statement
fails, it undoes all its changes. If on the other hand,
you updated the employee records one by one like this
update employees set salary = salary - 10000
where emp_id = 1;
update employees set salary = salary - 10000
where emp_id = 2;
...
update employees set salary = salary - 10000
where emp_id = 10;
only the one record that violated a constraint - or failed
for some other reason - would be removed.
A stored procedure or trigger is activated as part of a user
statement. For that reason, it succeeds or fails as a unit -
give or take error handling. Other databases treat stored
procedures like groups of statements. To each his gout..
Regards,
Ann
www.ibphoenix.com
We have answers.