It exchanges data with the database using internal Oracle date and timestamp datatypes so no conversion to and from character data is involved. When a Dynamic plug-in stage with TOCHAR and TODATE functions in user-defined SQL statements is migrated to the DRS Connector stage, the jobs can fail due to this difference.
Note:This function does not convert data to any of the other datetime datatypes. For information on other datetime conversions, please refer to, and.The default date format is determined implicitly by the NLSTERRITORY initialization parameter or can be set explicitly by the NLSDATEFORMAT parameter.The 'nlsparam' argument has the same purpose in this function as in the TOCHAR function for date conversion.Do not use the TODATE function with a DATE value for the char argument. The first two digits of the returned DATE value can differ from the original char, depending on fmt or the default date format.This function does not support CLOB data directly. However, CLOBs can be passed in as arguments through implicit data conversion.
![To_date Function In Sql To_date Function In Sql](/uploads/1/2/4/7/124750639/815753496.png)
See Also:and for more informationExamplesThe following example converts a character string into a date:SELECT TODATE('January 15, 1989, 11:00 A.M.' ,'Month dd, YYYY, HH:MI A.M.' ,'NLSDATELANGUAGE = American')FROM DUAL;TODATE('-15-JAN-89The value returned reflects the default date format if the NLSTERRITORY parameter is set to ' AMERICA'.
Different NLSTERRITORY values result in different default date formats:ALTER SESSION SET NLSTERRITORY = 'KOREAN';SELECT TODATE('January 15, 1989, 11:00 A.M.' ,'Month dd, YYYY, HH:MI A.M.' ,'NLSDATELANGUAGE = American')FROM DUAL;TODATE(-89/01/15Scripting on this page enhances content navigation, but does not change the content in any way.