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)

"Only Bad Coders Code Badly In Perl" (OBC2BIP)

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.