I have been trying to find what the issue might be but I am just out of luck and don\'t understand this problem at all.I have the following code:
CREATE OR R
If you want to be really robust about this then you ought to force the NLS setting to English and apply the "fill mode" format model FM for trimming leading and trailing spaces.
If To_Char(DateC,'fmDAY', 'nls_date_language=english') = 'FRIDAY'
Then ...
It is because day
variable contains a blank padded value. Use trim
function to get rid of leading and trailing spaces:
IF trim(day) = 'FRIDAY' THEN
checkFriday := 'Y';
END IF;
And please use VARCHAR2
datatype for string variables. Do not use VARCHAR
.