Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Re: MySQL / Perl

by aijin (Monk)
on Dec 20, 2001 at 01:46 UTC ( #133277=note: print w/ replies, xml ) Need Help??

in reply to MySQL / Perl

Well, you could create a table in the DB which holds the last value for the auto-increment field.

Then, when you're adding the data, grab the value in that table and use it as your starting point for the incrementation. I'm assuming you're writing record by record here. When you're done writing your records, write the last used value back into the table so that you can use it next time.


Comment on Re: MySQL / Perl
Re: Re: MySQL / Perl
by ehdonhon (Curate) on Dec 20, 2001 at 03:24 UTC

    See my text below. You don't need to do this. mysql is already doing exactly this for you.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2015-05-23 01:57 GMT
Find Nodes?
    Voting Booth?

    In my home, the TV remote control is ...

    Results (465 votes), past polls