DB2 - count department-wise employees who has the salary than the given input

Bandi
Posted by Bandi under Others category on | Points: 40 | Views : 555
CREATE PROCEDURE COUNT_PROC (P_SAL DECIMAL (8, 2), OUT P_COUNT INT)
SPECIFIC COUNT4
BEGIN
DECLARE V_COUNT INT DEFAULT 0;
FOR I AS SELECT SALARY FROM EMPLOYEES
DO
IF I.SALARY > P_SAL THEN
SET V_COUNT = V_COUNT +1;
END IF;
END FOR;
SET P_COUNT = V_COUNT;
END@

CALL COUNT_PROC (1000,?)

Comments or Responses

Login to post response