Re: Calling STORED PROCEDURE from INFORMIX-4GL
Posted in 1996
Danni Bauer (Dbauer@cris.com) wrote: : svario@zenacomp.zenacomp.com (Stefanie Vario) wrote: : >Kok-Bin (kok-bin_lee@hp.com) wrote: : >: Could anyone pls provide me some sample code demonstrating how to call stored : >: procedure in INFORMIX-4GL. I believe calling stored procedure in 4GL needs : >: other statements on top of EXECUTE PROCEDURE. : >: Thanks alot. : >: -- : >You need to prepare the statement first and then execute it. Example: : > prepare proc_stmt from "execute procedure <procname> ()" : > execute proc_stmt : >The above assumes that the procedure doesn't take any arguments and doesn't : >return any values. : >If you need to pass it any arguments, then use the following: : > prepare proc_stmt from "execute procedure <procname> (?,?,etc)" : > execute proc_stmt using arg1, arg2, etc : >If the procedure returns values, then you need to declare a cursor, open it, : >and do a fetch: : > prepare proc_stmt from "execute procedure <procname> (?,?,etc)" : > declare proc_curs cursor for proc_stmt : > open proc_curs using arg1, arg2, etc : > fetch proc_curs into var1, var2, etc : Ya don't NEED to prepare it. EXECUTE PROCEUDRE... works fine. What version of 4GL are you using where you don't need to prepare the "execute procedure" statement? I'm using 6.0 and I get an error if I just use "execute procedure <procname>()" without preparing it first. -- Stefanie Vario svario@zenacomp.com ZenaComp Incorporated http://www.zenacomp.com/~zenacomp