How to retrieve id number when inserting new record
Posted: Mon Aug 26, 2002 4:40 am
I'msaving a new order and I need the id number of the order, so that I can later add more things to this order.
Is this bulletproof?
i'm worried that if there are two or more new order creations at the same time, will I get the right number for every order?
-9902468
Is this bulletproof?
Code: Select all
start transaction;
execute insert;
if (insert succesfull){
execute select current(sequence_name) as number;
if (select succesfull){
commit;
}else{
rollback;
(error handling)
}
}else{
rollback;
(error handling)
}-9902468