Search Postgresql Archives

Stored function - send array as parameter to stored function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux