dynamic sql - Mailing list pgsql-sql

From Gabriel Adolfo Sirni
Subject dynamic sql
Date
Msg-id 50958.92462.qm@web36203.mail.mud.yahoo.com
Whole thread Raw
Responses Re: dynamic sql  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-sql
Error using the command EXECUTE IMMEDIATE with an OUT
parameter

Example: I have this procedure pr_prueba, who call
other procedure "pr_out_area_code" using the command
execute immediate, who has an IN paramter and an OUT
paramter.

Procedure pr_prueba(param in varchar2) is
v_name varchar2(50);
BEGIN
EXECUTE IMMEDIATE ' Begin pr_out_area_code(:1,:2);
End; ' USING param, OUT v_name;
END;

When I execute the procedure pr_prueba 

begin
pr_prueba('3491');
end;

The result is the following

ERROR: EDB-42601: syntax error at or near "$1" at
character 14
QUERY: SELECT out $1
LINE 1: SELECT out $1

I had make another test without an OUT parameter and
it works fine, but when I include an OUT parameter it
dosen't work.




Gabriel Adolfo Sirni

__________________________________________________
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis! 
Regístrate ya - http://correo.espanol.yahoo.com/ 


pgsql-sql by date:

Previous
From: Patrice Oliver
Date:
Subject: unsubscribe
Next
From: Tom Lane
Date:
Subject: Re: huge disparities in =/IN/BETWEEN performance