Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Sequences, last_insert_id, SQLite, and Oracle

by Ben Win Lue (Friar)
on Jun 14, 2005 at 11:53 UTC ( #466487=note: print w/ replies, xml ) Need Help??


in reply to Sequences, last_insert_id, SQLite, and Oracle

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

Comment on Re: Sequences, last_insert_id, SQLite, and Oracle
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://466487]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (6)
As of 2015-07-07 01:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (86 votes), past polls