PL/SQL date or to_char question begin
     if TO_CHAR('23-OCT-1994','DAY') = 'FRIDAY' THEN 
        DBMS_OUTPUT.PUT_LINE('FRIDAY');
     else
        DBMS_OUTPUT.PUT_LINE('Not Friday');
     end if;
     end;
     /


I am trying to see if 10/23/1994 is Friday.
If it is Friday, it is going to return FRI, if not, NOT FRI

However I get
"PL/SQL: numeric or value error: character to number conversion error".
'23-OCT-1994' is a string, not a DATE, so TO_CHAR on a character is pointless.

First you have to convert your string into a DATE value. You should specify the date format plus the language which is used:

TO_DATE('23-OCT-1994', 'DD-MON-YYYY', 'NLS_DATE_LANGUAGE = American')


Then you can compare with your weekday. Note, 'DAY' returns the weekday but padded with spaces up to the longest name. Try '"'||TO_CHAR(DATE '2018-10-23', 'DAY')||'"' to see the effect. You should also specify the language.

You can use one of the following:


TRIM(TO_CHAR(..., 'DAY', 'NLS_DATE_LANGUAGE = American')) = 'FRIDAY'
TO_CHAR(..., 'fmDAY', 'NLS_DATE_LANGUAGE = American') = 'FRIDAY'
TO_CHAR(..., 'DY', 'NLS_DATE_LANGUAGE = American') = 'FRI'


for example

begin
   if TO_CHAR(TO_DATE('23-OCT-1994', 'DD-MON-YYYY', 'NLS_DATE_LANGUAGE = American'),'fmDAY', 'NLS_DATE_LANGUAGE = American') = 'FRIDAY' THEN 
      DBMS_OUTPUT.PUT_LINE('FRIDAY');
   else
      DBMS_OUTPUT.PUT_LINE('Not Friday');
   end if;
end;