Can someone kindly explain me how can i accept user input in the below stored procedure
CREATE OR REPLACE PROCEDURE calsal
IS
CURSOR maxsal
IS
SELECT *
FROM emp;
max_sal emp.sal%TYPE;
BEGIN
SELECT MAX (sal)
INTO max_sal
FROM emp;
FOR i IN maxsal
LOOP
IF i.sal = max_sal
THEN
DBMS_OUTPUT.put_line ( ' Maximum salary plus bonus of '
|| i.empno
|| ' is '
|| (i.sal + i.sal * 0.5)
);
END IF;
END LOOP;
END;
The above program works fine,but if i want to keep a
WHERE condition in line No 12 i.e., WHERE deptno:=&deptno..My logic doesn't work by just putting like this.So,anyone can explain me what should i do in order to accept department number from user.
Thanks in advance!!