inserting arrays from plpgsql.

Поиск
Список
Период
Сортировка
От Bhuvan A
Тема inserting arrays from plpgsql.
Дата
Msg-id Pine.LNX.4.20.0203061910050.15559-100000@Larry
обсуждение исходный текст
Список pgsql-sql
Dear all,

i am trying to insert an array from a plpgsql function. But it didnt
work and i didnt know where i am wrong. hope to get some lights.

my need is something like this..

create table po
( comp_code text, po_no text, po_details text[]
);    
create table xx
( comp_code text, po_no text, po_line1 text, po_line2 text
);

and my function is..

create function ftest()
returns opaque as 'declare
 array_params po.po_details%type;

begin array_params := {new.po_line1, new.po_line2}; insert into po values (comp_code, po_no, params)
values(new.comp_code,new.po_no, array_params);
 

return new;
end;'
language 'plpgsql';

create trigger ttest after insert on xx for each row execute
procedure ftest();

----

my need is not exactly the same, but very similar.
Will be very happy, if I get some lights!         
Regards,
Bhuvaneswaran.




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

Предыдущее
От: Laszlo Tibor
Дата:
Сообщение: Re: getting pid of backend
Следующее
От: Bhuvan A
Дата:
Сообщение: assigning values to arrays in plpgsql