DYnamic SQL
Posted in 2008
Topics: Stored Procedures & SPL, Connectivity: ESQL/C, 4GL & Embedded SQL
Hi guys: Could anyone have a good working example of a ESQL program that would dymamically execute a stored procedure using SQLDA with parameters known only at the run time. If you have could you please post it here. thanks Ryan
On Tue, May 20, 2008 at 6:07 PM, Rajan S <srajan2@cox.net> wrote: > Hi guys: > Could anyone have a good working example of a ESQL program that would > dymamically execute a stored procedure using SQLDA with parameters known > only at the run time. > If you have could you please post it here. > thanks > Ryan If you don't mind reading through the Ruby wrapper: http://github.com/santana/ruby-informix/tree/master/ext/informixc.ec When your query doesn't return records or just a single one: line description ------------------------- 2416 prepares and allocates memory for input parameters 2483 binds input parameters, executes statement and retrieves output parameters When your query returns more than one record: line description ------------------------- 3082 prepares statement, declares cursor, allocates memory for output and input parameters 2586 fetches a record -- Gerardo Santana
Take a look at the dbcopy.ec and ul.ec utilities in my utils2_ak package. Those are ESQL/C programs that handle dynamic SQL. An execute procedure statements is no different than any SELECT statement except that prior to IDS 10.00 the sqlda did not contain field names after the DESCRIBE (under IDS 11.10 and later if the routine aliases its returns or uses output parameters then there will be field names). You can download the utils2_ak package from the IIUG Software Repository or the Oninit WEB Site. Art S. Kagel Oninit On Tue, May 20, 2008 at 7:07 PM, Rajan S <srajan2@cox.net> wrote: > Hi guys: > Could anyone have a good working example of a ESQL program that would > dymamically execute a stored procedure using SQLDA with parameters known > only at the run time. > If you have could you please post it here. > thanks > Ryan > > > _______________________________________________ > Informix-list mailing list > Informix-list@iiug.org > http://www.iiug.org/mailman/listinfo/informix-list >