Created On:  16 October 2012

Problem:

By default Oracle databases use a date format of DD-MMM-YY.

OpenESQL is documented to use ISO/ODBC format of YYYY-MM-DD.

When I try to update a DATE column using YYYY-MM-DD I get an error about incorrect format.

How can I use YYYY-MM-DD format to insert a date value into aan Oracle DATE column?

Resolution:

For Oracle databases you must first set the date format that you wish to use by executing the following command:

exec sql ALTER SESSION SET NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS' end-exec

You can then use YYYY-MM-DD format to insert or update date values in an Oracle DATE column.