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

From: "Merlin Moncure" <mmoncure(at)gmail(dot)com>
To: "Jean-Gerard Pailloncy" <jg(at)rilk(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: PL/SQL: function call like $1($2)
Date: 2006-10-09 13:35:31
Message-ID: b42b73150610090635m75edfeffg4cd1d5bcc82d3668@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 10/8/06, Jean-Gerard Pailloncy <jg(at)rilk(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Uyelik 2006-10-09 13:50:13 Re: PL/SQL: function call like $1($2)
Previous Message Lexington Luthor 2006-10-09 11:40:19 Re: Automatic locale detection?