Bruce Momjian wrote:
> $newSerialID = nextval('person_id_seq');
> INSERT INTO person (id, name) VALUES ($newSerialID, 'Blaise Pascal');
>
> Is this correct Perl? I don't see a nextval() function in Perl. Can
> you call SQL server-side functions natively from Perl?
Ofcourse not. This can be counted as 'pseudo-code'...
A correct implementation using DBI (and DBD::Pg) would be
$newSerialID = $dbh->selectrow_array (q{select
nextval('person_id_seq')});
$dbh->do (qq{INSERT INTO person (id, name) VALUES ($newSerialID, 'Blaise
Pascal')});
--
Alessio F. Bragadini alessio@albourne.com
APL Financial Services http://village.albourne.com
Nicosia, Cyprus phone: +357-2-755750
"It is more complicated than you think" -- The Eighth Networking Truth from RFC 1925