Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Date format error

Sagar DMay 2 2016 — edited May 2 2016

In the WHERE clause of a procedure:

AND  TO_DATE(loc.LAST_UPDATE_DATE,'DD-MM-YYYY') between TO_DATE(from_date,'DD-MM-YYYY') and TO_DATE(sysdate,'DD-MM-YYYY');

This gives me an error as:

ORA-01843: not a valid month

To use this i need to alter the session everytime I try to run the procedure.

alter session set nls_date_format = 'DD-MM-YYYY';


Is there any other way where i can run the procedure without passing the alter command every time I run the procedure?

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 30 2016
Added on May 2 2016
19 comments
3,031 views