Previous Topic: CALL StatementNext Topic: CALL of a Table Procedure


CALL of a Procedure

A procedure always returns zero or one result sets of parameters.

EXEC SQL
     CALL DEMOEMPL.GET_BONUS
      (1234, :BONUS-AMOUNT, :BONUS-CURRENCY)
END-EXEC

If the CALL is successful, indicated by an SQLSTATE of '00000' the host variables BONUS-AMOUNT and BONUS-CURRENCY will contain valid data, returned by the invoked routine for EMP-ID 1234, the input value supplied for the first parameter.