Re: writing a function to mimic mysql last_insert_id

Поиск
Список
Период
Сортировка
От Beth Gatewood
Тема Re: writing a function to mimic mysql last_insert_id
Дата
Msg-id 000901c259ba$c5b7ee70$0c00000a@bethvizx
обсуждение исходный текст
Ответ на Re: writing a function to mimic mysql last_insert_id  (Josh Berkus <josh@agliodbs.com>)
Ответы Re: writing a function to mimic mysql last_insert_id
Список pgsql-sql
Josh and Ross-

Thanks...I am well aware of currval and sequence use, and for me too this
would be the easiest solution ;-)

However, we are in the midst of porting a mysql database to pgsql.  The perl
application that is tied to this mysql database heavily utilizes
last_insert_id.  In an effort to save the perl developers the pain of having
to go in and modify a bunch of their SQL to call out to seq.currval, I
thought I would attempt to mimic this function.

Perhaps there is another way to approach this than writing this type of
function?

Thanks!
Beth

> -----Original Message-----
> From: Josh Berkus [mailto:josh@agliodbs.com]
> Sent: Wednesday, September 11, 2002 10:31 AM
> To: Beth Gatewood; pgsql-sql@postgresql.org
> Subject: Re: [SQL] writing a function to mimic mysql last_insert_id
>
>
>
> Beth,
>
> > I am wondering if I can get some input on the logic that I
> would need to
> > code a function that would mimic mysql's last_insert_id()..
>
> Um, what about CURRVAL('sequence-name')?
>
> --
> -Josh Berkus
>  Aglio Database Solutions
>  San Francisco
>



В списке pgsql-sql по дате отправления:

Предыдущее
От: "Ross J. Reedstrom"
Дата:
Сообщение: Re: writing a function to mimic mysql last_insert_id
Следующее
От: Josh Berkus
Дата:
Сообщение: Re: writing a function to mimic mysql last_insert_id