Passing Parameters to a Cursor FOR Loop
DECLARE
CURSOR c1(job VARCHAR2,
max_wage NUMBER) IS
SELECT *
FROM employees
WHERE job_id = job
AND salary > max_wage;
BEGIN
FOR person IN c1('CLERK',3000) LOOP
-- process data record
dbms_output.Put_line('Name = '
||person.last_name
||', salary = '
||person.salary
||', Job Id = '
||person.job_id);
END LOOP;
END;
/
0 comments:
Post a Comment