Talking about Oracle and
not working in a multiuser-environment, getting the last_insert_id is as easy as this:
select myseq.currval from dual;
with
- "myseq" being the Sequence you using
- "dual" is a table offered by oracle, that has always one entry
- ".currval" is the current value of the Sequence