Skip to Main Content

Oracle Database Discussions

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!

ORA-01821 when using TRUNC(CURRENT_DATE, 'DD')

3148279Jan 4 2016 — edited Jan 5 2016

I'm getting an intermittent "Oracle database error 1821: ORA-01821: date format not recognized" when using the SQL;


'SELECT TRUNC(CURRENT_DATE, 'DD') AS "SOMETEMP" FROM DUAL GROUP BY ()'


on Oracle11g. This does not occur on 10g. This appears to occur with OCI 11.0.4 and 11.03.


The NLS settings sent appear to be:

   NLS_DATE_FORMAT= 'DD-MO@N-RR'

   NLS_DATE_LANGUAGE= 'AMERICAN'

   NLS_TIME_FO@RMAT= 'HH.MI.SSXFF AM'

   NLS_TIMESTAMP_FORMAT= 'DD-MON-RR HH.MI.SS@XFF AM'

   NLS_TIME_TZ_FORMAT= 'HH.MI.SSXFF AM TZR'

   NLS_TIMESTAMP_T)Z_FORMAT= 'DD-MON-RR HH.MI.SSXFF AM TZR'

Along with the current timezone (which varies with the system clock):

   TIME_ZONE@= '+08:00'

Any thoughts?


Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 2 2016
Added on Jan 4 2016
6 comments
2,074 views