RE: execute SPL in 4gl
Posted in 1998
On Thu, 2 Jul 1998, Sharath Muppala wrote: > Your example is working. I am having Informix 4GL 7.2. I tried it in > the other way using "EXECUTE PROCEDURE ... INTO" . It is giving run time > error with error code 201 pointing the prepare statement line. As it should. > Is the problem still with 7.2 also. No, the problem is still in your code. > > > LET procedure_str = " EXECUTE PROCEDURE " , > > > " get_tts( ? , ? , ? , ? ) INTO ? " > > > PREPARE procedure_state FROM procedure_str You cannot PREPARE any statement with an INTO clause in it. In any language, ESQL/C, I4GL, D4GL, NewEra, SPL, ... In any version. You treat EXECUTE PROCEDURE statements which return values like you would a SELECT statement -- hence the PREPARE/DECLARE/FOREACH cycle Peter used. You can use: FOREACH c_cursor USING inval1, inval2, inval3, inval4 INTO outval ... END FOREACH rather than having to write out the OPEN USING, FETCH INTO, and CLOSE statements separately. You treat EXECUTE PROCEDURE statements which return no values like you would treat a DELETE statement -- you PREPARE and EXECUTE them. These rules apply in any language where you are using PREPARE and friends. Yours, Jonathan Leffler (jleffler@informix.com) #include <witticism.h> Guardian of DBD::Informix -- see http://www.perl.com/CPAN