Re: Sequences

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: "Hunter, Ray" <rhunter(at)enterasys(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Sequences
Date: 2002-02-11 15:51:37
Message-ID: 20020211155137.GA4605@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Mon, Feb 11, 2002 at 10:12:33AM -0500,
"Hunter, Ray" <rhunter(at)enterasys(dot)com> wrote:
> The only problem with this solution is that I have already incremented the
> sequence and need to use the current value? Is there a way to assign the
> value to a variable and then use it in an insert statement?

You should be doing this in one transaction in which case currval should
work. If you aren't doing it in one transaction, then your application
will need to remember the current value.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Chris Ruprecht 2002-02-11 17:25:48 Re: Sequences
Previous Message mallah 2002-02-11 15:38:57 Re: Sequences