Note
This variable is available starting with V2.2.30.
Description
nls_timestamp_format specifies the format for converting timestamp or timestamp ltz values to strings and for converting strings to timestamp or timestamp ltz values.
Applicability
This variable is applicable only to OceanBase Database in Oracle-compatible mode.
Privilege requirements
Query variables
Global level
systenants and all user tenants can execute theSHOW VARIABLESstatement or query theSYS.TENANT_VIRTUAL_GLOBAL_VARIABLEview (Oracle-compatible mode) to obtain the values of Global system variables.Session level
systenants and all user tenants can execute theSHOW VARIABLESstatement or query theSYS.TENANT_VIRTUAL_SESSION_VARIABLEview (Oracle-compatible mode) to obtain the values of Session system variables.
Modify variables
Global level
systenants can modify the values of Global system variables.Oracle user tenants must have the
ALTER SYSTEMprivilege to modify the values of Global system variables.
Session level
systenants and all user tenants can modify the values of Session system variables.
Attributes
| Attribute | Description |
|---|---|
| Parameter 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 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';