am Tue, dem 10.06.2008, um 11:56:39 +0200 mailte Shavonne Marietta Wijesinghe folgendes: > Hello > > 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(). Regards, Andreas -- Andreas Kretschmer Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header) GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql