8 Aug 2015

EXAMPLE OF CONTINUE IN PLSQL 11G

SQL> DECLARE
  2   V_CNTR NUMBER:=0;
  3   V_CURR_DATE DATE :=SYSDATE;
  4  BEGIN
  5   FOR I IN 1..31 LOOP
  6     CONTINUE WHEN V_CURR_DATE>LAST_DAY(SYSDATE);
  7     &D(V_CURR_DATE);
  8     V_CURR_DATE:=SYSDATE+I;
  9   END LOOP;
 10  END;
 11  /
08-AUG-15
09-AUG-15
10-AUG-15
11-AUG-15
12-AUG-15
13-AUG-15
14-AUG-15
15-AUG-15
16-AUG-15
17-AUG-15
18-AUG-15
19-AUG-15
20-AUG-15
21-AUG-15
22-AUG-15
23-AUG-15
24-AUG-15
25-AUG-15
26-AUG-15
27-AUG-15
28-AUG-15
29-AUG-15
30-AUG-15
31-AUG-15

No comments:

Post a Comment