Note
This variable was introduced in V2.2.30.
Description
The nls_timestamp_tz_format variable controls the format of timestamp tz values when they are converted to strings, and the format of strings when they are implicitly converted to timestamp tz values.
Applicability
This variable applies only to OceanBase Database in Oracle mode.
Privilege requirements
Query variables
Global level
The
systenant and all user tenants can execute theSHOW VARIABLESstatement or view theSYS.TENANT_VIRTUAL_GLOBAL_VARIABLEview (Oracle mode) to query the value of a global system variable.Session level
The
systenant and all user tenants can execute theSHOW VARIABLESstatement or view theSYS.TENANT_VIRTUAL_SESSION_VARIABLEview (Oracle mode) to query the value of a session system variable.
Modify variables
Set the variable at the global level
The
systenant can directly modify the value of a global system variable.An Oracle user tenant must have the
ALTER SYSTEMprivilege to modify the value of a global system variable.
Set the variable at the session level
The
systenant and all user tenants can directly modify the value of a session system variable in their own tenant.
Attributes
| Attribute | Description |
|---|---|
| Type | Varchar |
| Default value | DD-MON-RR HH.MI.SSXFF AM TZR |
| Effective scope | |
| Modifiable | Yes. You can modify this variable by using the SET statement. |
Considerations
This variable specifies the default time zone format for timestamp values when they are used with the TO_CHAR and TO_TIMESTAMP_TZ functions. The default value is YYYY-MM-DD HH24:MI:SS.FF TZR TZD.
Examples
Set the variable at the session level
obclient> SET nls_timestamp_tz_format='YYYY-MM-DD HH24:MI:SS.FF TZR TZD';Set the variable at the global level
obclient> SET GLOBAL nls_timestamp_tz_format='YYYY-MM-DD HH24:MI:SS.FF TZR TZD';