Oracle 명시적 커서 기본 구조

/* Formatted on 2012-01-17 오후 11:56:54 (QP5 v5.163.1008.3004) */
DECLARE
   -- 커서 선언
   CURSOR history
   IS
      SELECT * FROM hr.job_history;
   -- declare cursor record type
   rec   history%ROWTYPE;
BEGIN
   OPEN history;
   LOOP
      FETCH history INTO rec;
      IF history%NOTFOUND
      THEN
         EXIT;
      END IF;
      DBMS_OUTPUT.put_line (rec.employee_id);
   END LOOP;
   CLOSE history;
END;