ROCEDURE fill_block (where_clause_in IN VARCHAR2)
IS
c INTEGER := DBMS_SQL.OPEN_CURSOR;
emprec employee%ROWTYPE;
employee_id integer;
employee_nm varchar2(30);
fdbk INTEGER;
BEGIN
DBMS_SQL.PARSE (c, 'SELECT employee_id, last_name ' ||
' FROM employee' , DBMS_SQL.NATIVE);
DBMS_SQL.DEFINE_COLUMN (c, 1, emprec.empno);
DBMS_SQL.DEFINE_COLUMN (c, 2, emprec.ename, 30);
fdbk:= DBMS_SQL.EXECUTE (c);
LOOP
EXIT WHEN DBMS_SQL.FETCH_ROWS (c) = 0;
DBMS_SQL.COLUMN_VALUE (c, 1, emprec.empno);
DBMS_SQL.COLUMN_VALUE (c, 2, emprec.ename);
employee_id := emprec.empno;
employee_nm := emprec.ename;
END LOOP;
/* Clean up the cursor */
DBMS_SQL.CLOSE_CURSOR (c);
END;