Calling an Informix Stored Procedure Using SQL Passthru

Informix stored procedures are supported using SQL Passthru. These procedures need to be developed within Informix using the CREATE PROCEDURE command.

The adapter supports all scalar parameters: IN, OUT, and INOUT.


Top of page

Example: Calling a Stored Informix Procedure

The supported syntax to call a stored procedure is shown below. It is recommended that you use the syntax below instead of the previously supported CALLINF syntax.

ENGINE SQLINF
EX SAMPLE PARM1,PARM2,PARM3...;
TABLE ON TABLE PCHOLD
END

Top of page

Example: Informix Stored Procedure
CREATE PROCEDURE SAMPLE()
RETURNING CHAR(11), CHAR(20), CHAR(15), DATE, CHAR(1);
DEFINE a1 CHAR(11);
DEFINE b1 CHAR(20);
DEFINE c1 CHAR(15);
DEFINE d1 DATE;
DEFINE e1 CHAR(1);
FOREACH entry FOR SELECT ssn5, last_name5, first_name5, birthdate5, sex5 
INTO
a1,b1,c1,d1,e1 FROM 'edaqa'.NF29005
RETURN a1,b1,c1,d1,e1 WITH RESUME;
CONTINUE FOREACH;
END FOREACH
END PROCEDURE;

The following syntax is used to call the above stored procedure:

SQL SQLINF
EX SAMPLE;
TABLE ON TABLE PCHOLD
END


WebFOCUS