pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
@@IDENTITY
2+ messages / 2 participants
[nested] [flat]

* @@IDENTITY
@ 2004-11-10 17:59  Mike Fahey <mfahey@enter.net>
  0 siblings, 1 reply; 2+ messages in thread

From: Mike Fahey @ 2004-11-10 17:59 UTC (permalink / raw)
  To: pgsql-odbc


Does select @@IDENTITY  work with version 8.0.02 ?

IT returns "2" every single time.

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

Suggestions?



-- 
With best regards,

Mike Fahey - Systems Administration
********************************************************************
      ENTER.NET - "The Road to the Internet Starts Here!" (tm)
  (610) 437-2221 * http://www.enter.net/ * email:support@enter.net
********************************************************************




^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: @@IDENTITY
@ 2004-11-10 18:17  Peter Eisentraut <peter_e@gmx.net>
  parent: Mike Fahey <mfahey@enter.net>
  0 siblings, 0 replies; 2+ messages in thread

From: Peter Eisentraut @ 2004-11-10 18:17 UTC (permalink / raw)
  To: Mike Fahey <mfahey@enter.net>; 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/




^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2004-11-10 18:17 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-11-10 17:59 @@IDENTITY Mike Fahey <mfahey@enter.net>
2004-11-10 18:17 ` Peter Eisentraut <peter_e@gmx.net>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox