Saturday, February 15, 2020

PLSQL script to find out all Weekends of the Year

 FIND ALL SATURDAY AND SUNDAY OF YEAR

 Example:

     DECLARE
         ln_year NUMBER := &YEAR;
         ld_day  DATE;
     BEGIN
         ld_day := TO_DATE('01-JAN-'||TO_CHAR(ln_year), 'DD-MON-YYYY');
         WHILE ld_day < TO_DATE('31-DEC-'||TO_CHAR(ln_year), 'DD-MON-YYYY')
LOOP
           IF TO_CHAR(ld_day, 'D') IN (1,7) THEN
              dbms_output.put_line(TO_CHAR(ld_day));
           END IF;
           ld_day := ld_day + 1;
         END LOOP;
     END;
     /

No comments:

Post a Comment

Steps to get ZPL code output using Zebra viewer - Online

Introduction ZPL is a print language used by many label printers. A print language is a set of commands that can be used to draw elements li...