in reply to
Cycle through primary key with DBI
With MySQL your answer would be
REPLACE
.
With postgres you could try and UPDATE .... WHERE ref=ID and is it fails use an INSERT...
To get the last inserted key use :
$dbh->{'mysql_insertid'};
with mysql
(
Asim
already answered for Postgres)
"
O
nly
B
ad
C
oders
C
ode
B
adly
I
n
P
erl" (OBC2BIP)
Comment on
Re: Cycle through primary key with DBI
Download
Code
Replies are listed 'Best First'.
Re: Re: Cycle through primary key with DBI
by
fs
(Monk)
on Jun 05, 2001 at 00:58 UTC
If you're going to use the UPDATE method, you could probably simplify the logic by ensuring beforehand that the database is seeded up to the max limit.
[reply]
In Section
Seekers of Perl Wisdom