My Oracle Support Banner

Date Format Errors ORA-1801 on Database (Doc ID 846080.1)

Last updated on MARCH 10, 2019

Applies to:

Oracle Database - Enterprise Edition - Version and later
Oracle Database Cloud Schema Service - Version N/A and later
Oracle Database Exadata Express Cloud Service - Version N/A and later
Oracle Database Exadata Cloud Machine - Version N/A and later
Oracle Cloud Infrastructure - Database Service - Version N/A and later
Information in this document applies to any platform.


- Getting ORA-01801
- Had this error for over 2 years.
- Since upgraded the database to didn't have any problems.
- Today changed the application servers and we faced the problem.
- Rebooting database servers or application servers seemed to trigger the problem.

Workarounds Used reflect a change of syntax in an example query.  Substitute similar syntax for your query based on the example below:

Either use option 1 -

( (trunc(col1) >= trunc(col2) or trunc(col1) >= trunc(col2) ) )

or use option 2 -

( (col1 >= col2 or col1 >= col2 ) )

When facing the error changing query syntax from 1 to 2 or 2 to 1 will fix the issue

and ( (trunc(col1) >= trunc(col2) or trunc(col1) >= trunc(col2)
) )
-- above line is option 1
-- and ( (col1 >= col2 or col1 >= col2 ) )
-- above line is option 2

- Used the workaound for the bug 5555683 but this did not resolve the problem

ORA-01801: date format is too long for internal buffer

----- Call Stack Trace -----
    ksedmp ksddoa ksdpcg ksdpec ksfpec
       kgesev ksesec1 ldxdts evadds evaopn2
        evadcd qersoSORowP qerflFetchOutside qersoFetch opifch2
         opifch opipls opiodr rpidrus skgmstack
          rpidru rpiswu2 rpidrv psddr0 psdnal
           pevm_BFTCHC pfrinstr_FTCHC pfrrun_no_tool pfrrun plsql_run
            pricar pricbr prient2 prient kkxrpc
             kporpc opiodr ttcpip opitsk opiino
              opiodr opirip opidrv sou2o


To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!

In this Document

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.