This seems to be a silly question, however I will anyway try my luck here. Refer below code block, you'd see NEXT_DAY accepts both 1 and 'Sunday' as an argument in SELECT statement but in DBMS_OUTPUT.PUT_LINE only 'Sunday', and throws error for 1 - "ORA-01846: not a valid day of the week".
If I put 'Sunday', it works. Anything I'm missing here?
declare
wday varchar(10);
begin
select to_char(next_day(sysdate,1),'Day') into wday from dual; -- <== working with 1
dbms_output.put_line (wday);
select to_char(next_day(sysdate,'Sunday'),'Day') into wday from dual; -- <== working with 'Sunday'
dbms_output.put_line (wday);
--dbms_output.put_line (to_char(next_day(sysdate,1),'Day')); -- <== not working with 1
dbms_output.put_line (to_char(next_day(sysdate,'Sunday'),'Day')); -- <== working with 'Sunday'
end;
/
PS: My NLS configuration : 1 = Sunday