am Tue, dem 10.06.2008, um 11:56:39 +0200 mailte Shavonne Marietta Wijesinghe folgendes:
> I'm using Nextval and Currval in my ASP programme. But everytime i run the code
> only the nextval record is inserted and the currval record is lost. I wrote the
> INSERT INTO in the log and when i tried it via pgadmin both the records were
> inserted correctly, so there is no syntax error.
> I thought the problem would be the connection to the DB. I connect to the DB in
> the same ASP page where I do the INSERT INTO.
> What am i doing wrong?? Any ideas anyone??
I don't know your code, but nextval() returns the next sequence number
from a sequence and currval() returns the last with nextval() generated
sequence-number WITHIN THIS SESSION.
In a new session you can't use currval() first, you need to call
nextval() and later you can use currval().
Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net
In response to
pgsql-sql by date
|Next:||From: Shavonne Marietta Wijesinghe||Date: 2008-06-10 10:35:20|
|Subject: Re: Nextval & Currval|
|Previous:||From: Shavonne Marietta Wijesinghe||Date: 2008-06-10 09:56:39|
|Subject: Nextval & Currval|