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 execute the
SHOW VARIABLESstatement or query theSYS.TENANT_VIRTUAL_GLOBAL_VARIABLEview (Oracle mode) to view the values of global system variables, in both thesystenant and user tenants.Session level
Tenants can execute the
SHOW VARIABLESstatement or query theSYS.TENANT_VIRTUAL_SESSION_VARIABLEview (Oracle mode) to view the values of session system variables, in both thesystenant and user tenants.
Modify variables
Global effect
Tenants can modify global system variables in the
systenant and user tenants.For V4.x, tenants require the
ALTER SYSTEMprivilege to modify global system variables, as of V4.2.0 in Oracle mode.
Session effect
Tenants can directly modify session system variables in their own tenant, in both the
systenant and 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 |
Considerations
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';