Hi;
We're running "DB2 OS/390 7.1.1" and I would like to call a procedure from another procedure?
I wrote a procedure as follows but it doesn't return the values from the second procedure; it does return the values from the first procedure. Please help me out.
thanks in advance.
CREATE PROCEDURE MYSCH.SPROCTEST1
(
IN empId INTEGER
)
RESULT SETS 1
LANGUAGE SQL
COLLID DB2T
WLM ENVIRONMENT DB2TENV
SECURITY USER
RUN OPTIONS ''
P1: BEGIN
DECLARE DB2_SP_SQL1 CURSOR WITH RETURN FOR
SELECT * FROM MYSCH.EMP
WHERE EMP_ID =empId ;
-- Calling the Second Procedure
CALL MYSCH.SPROCTEST2;
OPEN DB2_SP_SQL1;
END P1
@
-- Grant access privilages to stored procedure
GRANT EXECUTE ON PROCEDURE MYSCH.SPROCTEST1 TO PUBLIC
@