Re: [HACKERS] FAQ error

2001-10-14 Thread Bruce Momjian
> Obviously, someone did because they tried the code and it didn't work. > At least the new code is closer to valid, though less clear. It is at > least a valid snippet, which the previous version was not. OK, I changed it to more pseudocode: new_id = output of "SELECT nextval('person_id_s

Re: [HACKERS] FAQ error

2001-10-14 Thread Bruce Momjian
> Bruce Momjian writes: > > > > Bruce Momjian writes: > > > > > > > OK, new FAQ code is: > > > > > > > > $sql = "SELECT nextval('person_id_seq')"; > > > > $newSerialID = ($conn->selectrow_array($sql))[0]; > > > > INSERT INTO person (id, name) VALUES ($newSerialID, 'Blaise Pascal'); >

Re: [HACKERS] FAQ error

2001-10-14 Thread Peter Eisentraut
Bruce Momjian writes: > > Bruce Momjian writes: > > > > > OK, new FAQ code is: > > > > > > $sql = "SELECT nextval('person_id_seq')"; > > > $newSerialID = ($conn->selectrow_array($sql))[0]; > > > INSERT INTO person (id, name) VALUES ($newSerialID, 'Blaise Pascal'); > > > $res = $db

Re: [HACKERS] FAQ error

2001-10-13 Thread Bruce Momjian
> Bruce Momjian writes: > > > OK, new FAQ code is: > > > > $sql = "SELECT nextval('person_id_seq')"; > > $newSerialID = ($conn->selectrow_array($sql))[0]; > > INSERT INTO person (id, name) VALUES ($newSerialID, 'Blaise Pascal'); > > $res = $dbh->do($sql); > > This code is still i

Re: [HACKERS] FAQ error

2001-10-13 Thread Peter Eisentraut
Bruce Momjian writes: > OK, new FAQ code is: > > $sql = "SELECT nextval('person_id_seq')"; > $newSerialID = ($conn->selectrow_array($sql))[0]; > INSERT INTO person (id, name) VALUES ($newSerialID, 'Blaise Pascal'); > $res = $dbh->do($sql); This code is still incorrect for any kno

Re: [HACKERS] FAQ error

2001-10-12 Thread Bruce Momjian
> On 10 Oct 2001 at 17:12 (-0400), Bruce Momjian wrote: > | > | Our FAQ, item 4.16.2 has: > | > | $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.

Re: [HACKERS] FAQ error

2001-10-11 Thread Peter Eisentraut
Bruce Momjian writes: > Our FAQ, item 4.16.2 has: > > $newSerialID = nextval('person_id_seq'); > INSERT INTO person (id, name) VALUES ($newSerialID, 'Blaise Pascal'); > > Is this correct Perl? No. I always thought it was pseudo code. I think it's fine. -- Peter Eisentraut [EMAI

Re: [HACKERS] FAQ error

2001-10-11 Thread Alessio Bragadini
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

Re: [HACKERS] FAQ error

2001-10-10 Thread Brent Verner
On 10 Oct 2001 at 17:12 (-0400), Bruce Momjian wrote: | | Our FAQ, item 4.16.2 has: | | $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 ca

[HACKERS] FAQ error

2001-10-10 Thread Bruce Momjian
Our FAQ, item 4.16.2 has: $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? -- Bruce Momj