On Wed, Mar 09, 2005 at 06:46:45 -0800,
Kumar S <ps_postgres@yahoo.com> wrote:
> Hi Stephan,
> Thank you very much, it was my stupid mistake.
>
> One more question. aplogies if this is also not so
> worthy question.
> In a transaction does currval work only if a previous
> statement defines it. In my case I wanted to get FK
> from existing currval in sample table (sample_id).
> when I execute my statements in a transasction, I get
> the following error. Do I have to just use a SELECT
> statement here, because currval is not working? Or did
> i made a mistake instead?
If you haven't used nextval in the current session, currval doesn't have
a value yet, so you can't use it. Which value would you expect it to use?