Re: 4GL Calling Stored Procedure ?
Posted in 1997
JoSchneidr wrote: > > Hi out there, > is there a possibility to execute a stored procedure from within a > 4gl program. I didn't find anything in the documentation about that > and trying to do this causes me compiler errors. It wouldn't be nice > to write a separate esqlc-module just to execute a stored procedure, > or > even create a trigger therefore. I actually did write a esqlc-module > and > linked it together with my 4gl stuff, but doing this is always a PITA > with > all the pushs and pops. Yes there is. Just PREPARE your stored procedure command and use EXECUTE to run it. If your stored procedure returns values, then you can't use EXECUTE. DECLARE a cursor for the PREPAREd statement and OPEN and FETCH in the normal way to return values. By using PREPARE, you are sending the command to the engine, which DOES know about stored procedures, whereas 4GL currently does not. :-) Hope that helps, -- Mark. +----------------------------------------------------------+-----------+ |Mark D. Stock - Informix SA http://www.informix.com |//////// /| |mailto:mdstock@informix.com FAQ http://www.iiug.org |///// / //| | +-----------------------------------+//// / ///| | Tel: +27 11 807 0313 |If it's slow, the users complain. |/// / ////| | Fax: +27 11 807 2594 |If it's fast, the users keep quiet.|// / /////| |Cell: +27 83 250 2325 |Therefore, "No news: travels fast"!|/ ////////| +----------------------+-----------------------------------+-----------+