pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter_e@gmx.net>
To: Mike Fahey <mfahey@enter.net>
To: Postgres list <pgsql-odbc@postgresql.org>
Subject: Re: @@IDENTITY
Date: Wed, 10 Nov 2004 19:17:59 +0100
Message-ID: <200411101917.59460.peter_e@gmx.net> (raw)
In-Reply-To: <419256E8.2070403@enter.net>
References: <419256E8.2070403@enter.net>

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/




view thread (2+ messages)

Message-ID: <200411101917.59460.peter_e@gmx.net>
Permalink:  ../200411101917.59460.peter_e@gmx.net/
Also on:    postgresql.org/message-id/200411101917.59460.peter_e@gmx.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-odbc@postgresql.org
  Cc: peter_e@gmx.net, mfahey@enter.net
  Subject: Re: @@IDENTITY
  In-Reply-To: <200411101917.59460.peter_e@gmx.net>
  References: <419256E8.2070403@enter.net> <200411101917.59460.peter_e@gmx.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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