Обсуждение: Calling a plpgsql function with an array of results?

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

Calling a plpgsql function with an array of results?

От
Wells Oliver
Дата:
Trying to call my function like so:

select myschema.myfunction(select myid from mytable);

myfunction has the signature: myfunction(integer[])

myid is an integer; I am trying to select them as an array to pass to the function.

Where am I going wrong? Thanks!

--
Wells Oliver
wellsoliver@gmail.com

Re: Calling a plpgsql function with an array of results?

От
Naoko Reeves
Дата:
How about
select myschema.myfunction(SELECT ARRAY(select myid from mytable));
?

On Mon, Apr 23, 2012 at 5:29 PM, Wells Oliver <wellsoliver@gmail.com> wrote:
Trying to call my function like so:

select myschema.myfunction(select myid from mytable);

myfunction has the signature: myfunction(integer[])

myid is an integer; I am trying to select them as an array to pass to the function.

Where am I going wrong? Thanks!

--
Wells Oliver
wellsoliver@gmail.com



--
Naoko Reeves