Обсуждение: RETURNING in stored procedure

Поиск
Список
Период
Сортировка

RETURNING in stored procedure

От
"Mehrotra, Abhinav (GE Healthcare)"
Дата:
Hi,

I have a table
 temp (name varchar(64),  seq  bigserial)

And a stored procedure :

Create function ......
..........
Val bigint;
BEGIN:
Val:= insert into temp("hello") RETURNING seq;
END;


I am unable to assign the value returned by seq into val.




-Abhinav

Re: RETURNING in stored procedure

От
"Leif B. Kristensen"
Дата:
On Friday 22. May 2009, Mehrotra, Abhinav (GE Healthcare) wrote:
>Val:= insert into temp("hello") RETURNING seq;

You may try:

INSERT INTO temp("hello") RETURNING seq INTO val;
--
Leif Biberg Kristensen | Registered Linux User #338009
Me And My Database: http://solumslekt.org/blog/