Note
This variable is available starting with V2.2.30.
Description
nls_timestamp_format specifies the format for converting a TIMESTAMP or TIMESTAMP_LTZ value to a string and for converting a string to a TIMESTAMP or TIMESTAMP_LTZ value.
Applicability
This variable is applicable only to OceanBase Database in Oracle mode.
Privilege requirements
Query variables
Global level
The
systenant and all user tenants can execute theSHOW VARIABLESstatement or query theSYS.TENANT_VIRTUAL_GLOBAL_VARIABLEview (Oracle mode) to view the value of a global system variable.Session level
The
systenant and all user tenants can execute theSHOW VARIABLESstatement or query theSYS.TENANT_VIRTUAL_SESSION_VARIABLEview (Oracle mode) to view the value of a session system variable.
Modify variables
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.
Session level
The
systenant and all user tenants can directly modify the value of a session system variable.
Attributes
| Attribute | Description |
|---|---|
| Type | varchar |
| Default value | DD-MON-RR HH.MI.SSXFF AM |
| Scope |
|
| Modifiable | Yes. You can execute the SET statement to modify the value. |
Usage
This variable specifies the default date format used with the to_CHAR and to_TIMESTAMP functions. The most commonly used value is YYYY-MM-DD HH24:MI:SS.FF.
Examples
Session level
obclient> SET nls_timestamp_format='YYYY-MM-DD HH24:MI:SS.FF';Global level
obclient> SET GLOBAL nls_timestamp_format='YYYY-MM-DD HH24:MI:SS.FF';
