Stored function - send array as parameter to stored function

Поиск
Список
Период
Сортировка
От hendra kusuma
Тема Stored function - send array as parameter to stored function
Дата
Msg-id 26dadb3d0811121804l77d2b9aawdb346c3f6ec03823@mail.gmail.com
обсуждение исходный текст
Ответы Re: Stored function - send array as parameter to stored function  (brian <brian@zijn-digital.com>)
Список pgsql-general
Hi,
I'm new here
I've been doing a little self-learning about postgresql
and find it very interesting

I've been trying to create a stored procedure that receive array as
parameter and find a good and working example on the web

the code looks like this

create or replace function iterate(a int[])
returns void as $$
begin
 for i in array_lower(a,1)..arry_upper(a,1) loop
   raise notice '%', a[i];
 end loop;
end;
$$ language plpgsql strict;

my problem is, how should I call this function?
I tried
select iterate(1,2)
select iterate([1,2])
select iterate({1,2})
none of them are working

how is it really to call this function

Thank you
Hendra

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

Предыдущее
От: Yi Zhao
Дата:
Сообщение: can someone help me to make a sql more pretty and more concise?
Следующее
От: Greg Smith
Дата:
Сообщение: Re: Upgrading side by side in Gentoo