Actually, I've been laboring for quite a while now under the assumption
that it wasn't, but I recently discovered I was wrong.
All you have to do is prepare and execute the statement. Put the normal
? parameter place-holders in the statement, and open/fetch the cursor if
there are return values. Works bloody good.
: All you have to do is prepare and execute the statement. Put the normal
: ? parameter place-holders in the statement, and open/fetch the cursor if
: there are return values. Works bloody good.
To clarify and kibitz:
PREPARE st_proc FROM "EXECUTE PROCEDURE whatever(?,?)"
If the SPL does *not* return anything:
EXECUTE st_proc USING var1, var2
If the SPL *does* return anything:
DECLARE c_proc CURSOR FOR st_proc
OPEN c_proc USING var1, var2
WHILE TRUE
FETCH c_proc INTO whatever
IF status = NOTFOUND THEN
EXIT WHILE
END IF
END WHILE
CLOSE c_proc
FREE c_proc
--
=======================================================================
Dennis J. Pimple den...@informix.com Opinions expressed
Senior Consultant -------------------- are mine, and do not
Informix Software Inc Voice: 303-850-0210 necessarily reflect
Denver Colorado USA Fax: 303-779-4025 those of my employer.
Also worth noting that, used in conjunction with the RETURN...WITH RESUME
feature of SPL, you can use the cursor in the 4gl prog like any other
cursor and return multiple rows from the procedure.
ak...@cix.compulink.co.uk (Andy Kent)
------------------------------------------------
Freelance Informix Database Specialist,
Redland, Bristol, England