1CREATE OR REPLACE PROCEDURE oracle_runtime_query_pcd IS
2 TYPE ref_cursor IS REF CURSOR;
3 l_cursor ref_cursor;
4 v_query varchar2(5000);
5 v_name varchar2(64);
6BEGIN
7 v_query := 'SELECT name FROM employee WHERE employee_id=5';
8 OPEN l_cursor FOR v_query;
9 LOOP
10 FETCH l_cursor INTO v_name;
11 DBMS_OUTPUT.put_line(v_name);
12 EXIT WHEN l_cursor%NOTFOUND;
13 END LOOP;
14 CLOSE l_cursor;
15END;