Categories
mysql oracle sql-server stored-procedures

How to fix identifier must be declared in a stored procedure?

I’m creating a procedure and then execute it in SQL plus. The procedure is correctly created / updated, as you can see from the following code.

SQL> create or replace procedure add_sal(i_empno number, addsal out number)
2 is
3 begin
4 select sal+1000
5 into addsal
6 from emp
7 where empno=i_empno;
8 end;
9 /
Procedure created.

When I try to execute the procedure I’m getting an error that I don’t understand.

SQL> exec add_sal(i_empno,addsal);
BEGIN add_sal(i_empno,addsal); END;
*
ERROR at line 1:
ORA-06550: line 1, column 15:
PLS-00201: identifier 'I_EMPNO' must be declared
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored

Where am I going wrong?