Hi All,
I need to write a insert statement with sequence generated key and a rollback script for the same
The emp_id comes from sequence. SEQ_EMP_IDThe insert statement is
insert into employees(seq_emp_id.nextval, 'Jon' , 'Bon', sysdate);
and for the rollback script
delete from employees where emp_id =<seq_value> say 40.
Is it possible to decrement the sequence value. Basically two things I am in doubt
1) How to insert the sequence value in the insert statement. don't see any triggers defined. CONSTRAINT "EMP_ID" PRIMARY KEY ("SEQ_EMP_ID")
2) How to write a proper rollback script by reverting the sequence as well.
Thanks