Try OpenEdge Now
skip to main content
DataServer for Oracle
Initial Programming Considerations : Data types : Working with Datetime data types : Converting datetime data types between OpenEdge and Oracle
 
Converting datetime data types between OpenEdge and Oracle
Maintaining proper session time settings is critical to ensuring accurate datetime data type conversion between an OpenEdge application and an Oracle data source. The datetime data types are converted in either a default or non-default mode.
In the default setting, the client time zone context is set by the operating system on which the client operates, providing local context for timestamp values in an OpenEdge application. Oracle DataServer controls the OIC session time, setting it to Universal Coordinated Time (UTC).
In the non-default setting, you can set the application time zone context via the OIC session time. You employ the non-default setting through the -Dsrv startup parameter. Utilize the following syntax:

Syntax

-Dsrv native-tz-context time-zone-value
The time zone value must be a string value in a supported format such as "local", "-5.0", "-8.00", "dbtimezone", or "Europe/London".
You may also choose to invoke the -Dsrv native-tz-context parameter without specifying a time zone value. If so, the parameter will not set the default timezone session to UTC. This will allow the OpenEdge client application to set the session time zone, such as through the RUN STORED-PROC interface. The Oracle command used to set the OCI session time zone is:
ALTER SESSION SET time_zone = 'time-zone-value';
Note: OpenEdge DataServer client applications referencing DATETIME or DATETIME-TZ datatypes mapped to Oracle TIMESTAMP WITH TIME ZONE datatype are required to set the session time zone using the -Dsrv native-tz-context parameter only by specifying the time zone value in any supported format accepted by Oracle TIME_ZONE setting or it can also be set with the RUN STORED-PROC interface using ALTER SESSION SET time_zone = 'time-zone-value' with the time-zone-value in "TZH:TZM" format. Setting the session time zone by other means may result in inaccurate data.