Previous Topic Next topic Print topic


Date and Timestamp Formatting with OpenESQL for OCI

OpenESQL for OCI supports the regular SQL formatting directives DATE, TIME, DATEDELM, TIMEDELIM and TSTAMPSEP. The default format is the same as ODBC. When an OCI connection opens, OpenESQL executes these Oracle SQL statements to achieve date/time formatting.

alter session set nls_date_format = 'YYYY-MM-DD HH24:MI:SS'
alter session set NLS_TIMESTAMP_FORMAT = 'YYYY-MM-DD HH24:MI:SS.FF9'
alter session set NLS_TIMESTAMP_TZ_FORMAT = 'YYYY-MM-DD HH24:MI:SS.FF9 TZH:TZM'

If you want to use Oracle's default session settings or use alter session statements in your application, you must use -OPTSQL "DATE=EXTERNAL". In this case, OpenESQL passes values directly to and from Oracle without any additional formatting.

Previous Topic Next topic Print topic