Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^3: Sequences, last_insert_id, SQLite, and Oracle

by etcshadow (Priest)
on Jun 15, 2005 at 19:42 UTC ( [id://467033]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Sequences, last_insert_id, SQLite, and Oracle
in thread Sequences, last_insert_id, SQLite, and Oracle

Yes, you can do this by accessing the sequence, and then inserting that value (explicitly), as two sequential statements in a transaction. What I was referring to was the standard oracle method of defining a sequence and using an on-insert trigger to bind the sequence to the id column of the table (so that inserts *implicitly* fetch from the sequence). For the case of the sequence used in a trigger (thus your code is not directly accessing the sequence), this is The Way. However, if you're not using triggers to pull from your sequence implicitly, then you can certainly fetch from the sequence and just use that value.
------------ :Wq Not an editor command: Wq

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (7)
As of 2024-09-17 08:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The PerlMonks site front end has:





    Results (22 votes). Check out past polls.

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.