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