Re: Stored Procedures
Posted in 1993
>From: uunet!Thalatta.COM!bossert (John Bossert) >Subject: Stored Procedures >Date: 21 Apr 93 03:31:27 GMT >X-Informix-List-Id: <news.3084> > >Do stored procedures (5.01 OnLine engine) work with either 4.1 4GL >or with 4.1 E/SQL-C? > >If not, how does one access/execute them? No, and Yes, but mainly Yes. No, you can't put EXECUTE PROCEDURE statements into 4.10 tools code. Yes, you can prepare and execute EXECUTE PROCEDURE statements. If the stored procedure returns multiple rows of data, you will do: PREPARE p_execproc FROM "EXECUTE PROCEDURE procname(1, 2, 3)" DECLARE c_execproc CURSOR FOR p_execproc OPEN c_execproc WHILE SQLCA.SQLCODE = 0 FETCH c_execproc INTO var1, var2, var3, ..., varN IF SQLCA.SQLCODE != 0 THEN EXIT WHILE END IF ... END WHILE CLOSE c_execproc FREE p_execproc If it doesn't return any data, you can simply PREPARE and EXECUTE the statement (or use EXECUTE IMMEDIATE in ESQL/C but not I4GL). You can use question marks and USING clauses to pass variable parameters to the statement. I can't remember if you can use DESCRIBE to get the information about the return parameters -- I think you should be able to, but whether you can or not is another matter. Yours, Jonathan Leffler (johnl@obelix.informix.com) #include <disclaimer.h>