Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^2: DBI insert: Need to retrieve an autoincremented column from a table after an insert.

by runrig (Abbot)
on Aug 09, 2008 at 22:06 UTC ( [id://703334]=note: print w/replies, xml ) Need Help??


in reply to Re: DBI insert: Need to retrieve an autoincremented column from a table after an insert.
in thread DBI insert: Need to retrieve an autoincremented column from a table after an insert.

assign the id from a common source independent of the database

I would want to keep the sequence ids in the database...one way to do that in a portable way is with DBIx::Sequence.

  • Comment on Re^2: DBI insert: Need to retrieve an autoincremented column from a table after an insert.

Replies are listed 'Best First'.
Re^3: DBI insert: Need to retrieve an autoincremented column from a table after an insert.
by hangon (Deacon) on Aug 10, 2008 at 00:20 UTC
    I would want to keep the sequence ids in the database

    I agree, its one of the warts from using a separate file. Like the OP, I've never completely trusted last_insert_id either, and getting unique row id's is just not an easy thing to do portably. I wasn't aware of DBIx::Sequence, just tried it out and it seems to work as advertized. Thanks for the pointer.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (4)
As of 2024-04-25 06:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found