Re: ESQL & Stored Procedures
Posted in 1994
Jonathan Leffler — — source: Informix-list mailing list archive (1991-1998)
>From: declan@MCS.COM (Declan O'Reilly)
>Subject: ESQL & Stored Procedures
>Date: 13 Jul 1994 14:29:36 -0500
>X-Informix-List-Id: <news.7586>
>
> To call a stored procedure from ESQL/C do you have to use
> Dynamic SQL or can you say something like as follows
>
> EXEC SQL declare procursor for
> execute my_procedure into :return_var1, :return_var2
Give or take some syntactic details, you can do what you want:
func()
{
EXEC SQL BEGIN DECLARE SECTION;
int return_var1;
int return_var2;
EXEC SQL END DECLARE SECTION;
EXEC SQL DECLARE c_proc CURSOR FOR
EXECUTE PROCEDURE my_procedure(1) INTO :return_var1, :return_var2;
}
Yours,
Jonathan Leffler (johnl@informix.com) #include <disclaimer.h>