Re: PL/SQL: function call like $1($2)

Поиск
Список
Период
Сортировка
От Uyelik
Тема Re: PL/SQL: function call like $1($2)
Дата
Msg-id 452A5395.30400@yorukoglu.name.tr
обсуждение исходный текст
Ответ на Re: PL/SQL: function call like $1($2)  ("Merlin Moncure" <mmoncure@gmail.com>)
Список pgsql-general
Hi,
you may try;

execute 'select ' || f || '(' || p || ')' into res;

Merlin Moncure wrote, On 09.10.2006 16:35:
On 10/8/06, Jean-Gerard Pailloncy <jg@rilk.com> wrote:
I want to create a function in PL/SQL as
CREATE OR REPLACE FUNCTION "f_do" (text, double precision[]) RETURNS
double precision AS '
DECLARE
     f text := $1;
     p double precision[] := $2;
     res double precision;
BEGIN
     SELECT f(p) into res;
     RETURN res;
END;' LANGUAGE "plpgsql"
STABLE
RETURNS NULL ON NULL INPUT
SECURITY INVOKER

But it does not work.
I try EXECUTE f || ' ( ' || p || ' );' INTO res
But is does not work too.
There is no function to convert double precision[] to text.

Is it possible to do this without converting the array of double to
text ?


what is are the arguments for function f()?
Also, if you are using 8.0+, you can do dollar quoting and named input
parameters.  If not, i think using alias is preferred to assignment
for giving names to arguments.

merlin

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

              http://www.postgresql.org/docs/faq


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

Предыдущее
От: John DeSoi
Дата:
Сообщение: Re: column privileges
Следующее
От: Tom Lane
Дата:
Сообщение: Re: column privileges