Re: problem fetching currval of sequence

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: Charles Hauser <chauser(at)duke(dot)edu>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: problem fetching currval of sequence
Date: 2002-08-06 21:26:58
Message-ID: 200208061426.58011.josh@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


Charles,

> I know this script worked in the past, but I have not used it
> recently. We are running PostgreSQL 7.1.3. It would be great if
> this would work as I have several scripts which operate in a similar
> manner for different TABLES, but if it won't work I'll work around it.
>
> Suggestions for the best way to get the value for the gb_id after an INSERT?

I usually SELECT NEXTVAL(), and then pass that ID number to the INSERT
statement. It's very reliable.

--
-Josh Berkus

______AGLIO DATABASE SOLUTIONS___________________________
Josh Berkus
Complete information technology josh(at)agliodbs(dot)com
and data management solutions (415) 565-7293
for law firms, small businesses fax 621-2533
and non-profit organizations. San Francisco

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message rramostalo 2002-08-06 22:12:46 control reaches end of trigger procedure without RETURN
Previous Message Charles Hauser 2002-08-06 20:53:24 Re: problem fetching currval of sequence