Re: @@IDENTITY

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Mike Fahey <mfahey(at)enter(dot)net>, Postgres list <pgsql-odbc(at)postgresql(dot)org>
Subject: Re: @@IDENTITY
Date: 2004-11-10 18:17:59
Message-ID: 200411101917.59460.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

Mike Fahey wrote:
> Does select @@IDENTITY work with version 8.0.02 ?
>
> IT returns "2" every single time.

@ is the absolute value operator. You probably have a column "identity"
that contains 2 or -2.

> All I want to do is get the last inserted id from a sequence.

Use the currval() function.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

In response to

  • @@IDENTITY at 2004-11-10 17:59:04 from Mike Fahey

Browse pgsql-odbc by date

  From Date Subject
Next Message Gary Doades 2004-11-10 19:15:42 Re: ODBC Driver stability
Previous Message Mike Fahey 2004-11-10 17:59:04 @@IDENTITY