title: How do I get the day portion(as a string/char) from a date and run tests on it in PL/SQL?
body: <p>Can someone just tell me why this doesn't work. As far as I know, I've put the string into the variable and wanted to test it but it didn't seem to work and brought up errors.</p>
  
  <pre><code>SET SERVEROUTPUT ON;
  
  DECLARE
      DATETODAY DATE := SYSDATE;
      DAYT VARCHAR2(10);
  
  BEGIN
     SELECT TO_CHAR(SYSDATE,'DAY') INTO DAYT FROM DUAL;
     DBMS_OUTPUT.PUT_LINE('The date today is '||DATETODAY ||' and it is ' ||DAYT);
  
     IF DAYT = 'SATURDAY' OR DAYT = 'SUNDAY' THEN
         : DBMS_OUTPUT.PUT_LINE('Today is '||DAYT||' and its is a weekend');
     ELSE
         : DBMS_OUTPUT.PUT_LINE('Today is '||DAYT||' and its a week day');
     END IF;
  
  END;
  /
  </code></pre>