U moet de parameter twee keer opnemen in de clausule USING:
OPEN emp_cv FOR sql_stmt USING my_job, my_job;
Hier is uw voorbeeld, maar vereenvoudigd:
DECLARE
TYPE EmpCurTyp IS REF CURSOR;
emp_cv EmpCurTyp;
emp_rec varchar2(10);
sql_stmt VARCHAR2(200);
my_job VARCHAR2(15) := 'X';
BEGIN
OPEN emp_cv FOR 'select * from dual where dummy = :j or dummy = :j'
USING my_job, my_job;
LOOP
FETCH emp_cv INTO emp_rec;
EXIT WHEN emp_cv%NOTFOUND;
END LOOP;
CLOSE emp_cv;
END;