Im a newbie to Oracle and trying to create a new procedure but getting a error,
Error-expression P_EMP_SAL cannot be used as an INTO target of SELECT/FETCH statement..
CREATE OR REPLACE PROCEDURE getempsal(
p_emp_id IN NUMBER,
p_emp_month IN CHAR,
p_emp_sal in INTEGER)
AS
BEGIN
SELECT EMP_SAL
INTO p_emp_sal
FROM EMPLOYEE_SAL
WHERE EMP_ID = p_emp_id
and EMP_MONTH = p_emp_month;
END getempsal;
You specify
INfor a parameter you want to return from a procedure. Tryp_emp_sal OUT INTEGER.http://docs.oracle.com/cd/E11882_01/appdev.112/e25519/subprograms.htm#i4107