Note
This variable was introduced in V2.2.30.
Description
The nls_date_format variable controls the format for converting a date to a string and the format for implicitly converting a string to a date.
Applicability
This variable applies only to OceanBase Database in Oracle mode.
Privilege requirements
Query variables
Global level
Tenants can use the
SHOW VARIABLESstatement or theSYS.TENANT_VIRTUAL_GLOBAL_VARIABLEview (in Oracle mode) to view the values of global system variables, whether they are in thesystenant or user tenants.Session level
Tenants can use the
SHOW VARIABLESstatement or theSYS.TENANT_VIRTUAL_SESSION_VARIABLEview (in Oracle mode) to view the values of session system variables, whether they are in thesystenant or user tenants.
Modify variables
Global effect
Tenants can directly modify global system variables in the
systenant and user tenants.For V4.x, tenants need the
ALTER SYSTEMprivilege to modify global system variables, starting from V4.2.0 in Oracle mode.
Session effect
Tenants can directly modify session system variables in their own tenant, whether they are in the
systenant or user tenants.
Attribute description
| Attribute | Description |
|---|---|
| Parameter type | Varchar |
| Default value | DD-MON-RR |
| Effect scope |
|
| Modifiable | Yes. The value can be modified by using the SET statement. |
| Plan-influencing | Yes |
Usage notes
The data type of start_date is DATE. The system variable NLS_DATE_FORMAT specifies the format model for converting the start_date value to a text value, which is then passed to the SQL text. The date and time format model can be a string enclosed in double quotation marks.
Configuration examples
Set the format for converting a date to a string to DD-MON-RR.
Session effect
obclient> SET nls_date_format='DD-MON-RR';Global effect
obclient> SET GLOBAL nls_date_format='DD-MON-RR';