Advertisement
VoronVU

CURSOR, LOOP, OPEN с параметрами

Jan 20th, 2015
732
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. CREATE OR REPLACE PACKAGE BODY REVELATION.EMT AS
  2.  
  3. CURSOR curPLAN(d DATE) RETURN EMT_PLAN IS
  4.   SELECT
  5.     *
  6.   FROM
  7.     EMT_PLAN ep
  8.   WHERE
  9.     TRUNC(ep.REP_RUN_DATE) = d;
  10.  
  11. PROCEDURE CLMAIN_RUNNER AS
  12.   rowPLAN EMT_PLAN%ROWTYPE;
  13. BEGIN
  14.   OPEN curPLAN(TRUNC(SYSDATE));
  15. LOOP
  16.   FETCH curPLAN INTO rowPLAN;
  17.   EXIT WHEN curPLAN%NOTFOUND;
  18. END LOOP;
  19. END;
  20.  
  21.  
  22. END EMT;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement