Re: mysql's last_insert_id

From: Bo Lorentsen <bl(at)netgroup(dot)dk>
To: Michal Adamczakk <pokryfka(at)artland(dot)com(dot)pl>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: mysql's last_insert_id
Date: 2003-08-28 07:06:55
Message-ID: 1062049686.1925.1408.camel@localhost
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, 2003-08-22 at 22:03, Michal Adamczakk wrote:

> how to implement mysql's last_insert_id() ?
You will be able to use the "PQoidValue" function that returns the last
inserted row oid, just after an insert command.

Then if you want the newly inserted row you do something like this
"SELECT * FROM table_name WHERE oid=42", where 42 is the oid number
returned from the "PQoidValue".

Now ... I know that its possible to omit the oid's from large tables,
and then this method will not work anymore. What to do in this case
still eludes me (Anyone ?) :-)

/BL

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bo Lorentsen 2003-08-28 07:06:56 Re: 7.4b1 vs 7.3.4 performance
Previous Message Randal L. Schwartz 2003-08-28 06:30:08 Re: Functions have 32 args limt ???