create or replace PROCEDURE CREATE_DEL_DEPT <br>
(
PARAM1 IN VARCHAR2 Default '%',
PARAM2 IN VARCHAR2 Default '%',
PARAM3 IN BOOLEAN Default True
) AS
PRAGMA AUTONOMOUS_TRANSACTION;
CURSOR Employees IS
Select Employee_ID, First_name, Last_Name
From HR.employees Where Department_ID = PARAM2;
BEGIN
For Employee_ID in Employees LOOP
if Department_ID = 20 then
DBMS_OUTPUT.PUT_LINE ('test');
elsif Department_ID = 30 then
DBMS_OUTPUT.PUT_LINE ('test1');
else
DBMS_OUTPUT.PUT_LINE ('else test');
end if;
END LOOP;
END;
I'm getting following error. Line 14 is where starting of 'If' statement is
Error(14,9): PL/SQL: Statement ignored
Where Department_ID = PARAM2won't match'%'. Equality doesn't take wildcards