I am trying to create a procedure that I can call upon that would alter the date format and I am having some issues and could use some help.
If I try this code:
create or replace PROCEDURE DATE_SESSION IS
BEGIN
ALTER SESSION SET NLS_date_format = 'MM/DD/YYYY';
END;
I get this error:
Error starting at line : 1 in command -
DATE_SESSION
Error report -
Unknown Command
And if I try this code:
create or replace PROCEDURE DATE_SESSION IS
BEGIN
EXECUTE IMMEDIATE 'ALTER SESSION SET NLS_date_format = 'MM/DD/YYYY';';
END;
And then execute it with:
DATE_SESSION
I get this error:
Error starting at line : 1 in command -
DATE_SESSION
Error report -
Unknown Command
Any insight would be greatly appreciated.