Hi,
i will be doing an update then an insert so i want to use the transaction to make sure if one fails the other wont do what its supposed to do. But there is a little problem, in my insert function i call the update function first. How can i run the same transaction while calling a function? If i dump all update function code in insert function section it gets ugly so i want to keep it seperate but also be able to use the same transaction for both.
How can i do this?
thanks in advance
-shane
it will be something like:
insert function start
declare transaction
update function starts with transaction
update function runs but transaction.commit isnt called yet
insert function runs with transaction
if everything is ok transaction.commit 'update and insert is now complete
something is wrong transaction.rollback 'update and insert both fail
end insert function
i will be doing an update then an insert so i want to use the transaction to make sure if one fails the other wont do what its supposed to do. But there is a little problem, in my insert function i call the update function first. How can i run the same transaction while calling a function? If i dump all update function code in insert function section it gets ugly so i want to keep it seperate but also be able to use the same transaction for both.
How can i do this?
thanks in advance
-shane
it will be something like:
insert function start
declare transaction
update function starts with transaction
update function runs but transaction.commit isnt called yet
insert function runs with transaction
if everything is ok transaction.commit 'update and insert is now complete
something is wrong transaction.rollback 'update and insert both fail
end insert function