title: Check if a date is Sunday
body: <p>I want to get 6 days of the week starting from the given date, but the if clause is not taking the 'SUNDAY'.</p>
  
  <pre><code>V DATE :=TO_DATE (&amp;H, 'DDMMYYYY');
  V1 DATE:=V+6;
  V2 VARCHAR(10);
  BEGIN
    WHILE V&lt;V1 LOOP
      V2:=TO_CHAR(V,'DAY');
  
      IF V2='SUNDAY' THEN 
        DBMS_OUTPUT.PUT_LINE('TODAY IS SUNDAY');-- IF IS NOT TAKING THE VALUE
      END IF;
  
      DBMS_OUTPUT.PUT_LINE(V2||V);
  
      V:=V+1;
    END LOOP;
  END;
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>FRIDAY   19-SEP-14 
  SATURDAY 20-SEP-14 
  SUNDAY   21-SEP-14 
  MONDAY   22-SEP-14 
  TUESDAY  23-SEP-14 
  WEDNESDAY24-SEP-14
  </code></pre>