Re: Calling STORED PROCEDURE from INFORMIX-4GL
Posted in 1996
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. Danni Danni Bauer Dbauer@concentric.net Unix/Informix/C <a href="http://www.concentric.net/~Dbauer">Home Page</a> <a href="http://www.concentric.net/~Dbauer/RESUME.shtml">Resume</a>