Re: SPL in 4GL 7.2?
Posted in 2000
Edward Rosenthal wrote:
>
> yes.
> use a prepare statement to execute the procedure:
>
> define myf1 like mytable.f1
> define myf2 like mytable.f2
>
> prepare mystatement from "execute procedure myprocedurename ()"
> declare mycursor for mystatement
> foreach mycursor into myf1, myf2
> ...
> end foreach
>
> the procedure might look like:
> create procedure myprocedurename ()
> returning smallint, smallint> foreach SELECT bla bla bla from bla bla etc...
> return f1, f2 with resume;
> end foreach;
> return f1, f2;
> end procedure
Of course if your SP doesn't have a RETURN clause, you don't need to
DECLARE a cursor. You can just EXECUTE the prepared statement.
Cheers,
--
Mark.
+----------------------------------------------------------+-----------+
| Mark D. Stock mailto:mdstock@mydas.freeserve.co.uk |//////// /|
| http://www.informix.com http://www.informixhandbook.com |///// / //|
| http://www.iiug.org +-----------------------------------+//// / ///|
| |This email will self-destruct in |/// / ////|
| |10 sec. If you received this email |// / /////|
| |in error, sorry about the mess. |/ ////////|
+----------------------+-----------------------------------+-----------+