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 query the values of global system variables by using the
SHOW VARIABLESstatement or theSYS.TENANT_VIRTUAL_GLOBAL_VARIABLEview (Oracle mode).Session level
Tenants can query the values of session system variables by using the
SHOW VARIABLESstatement or theSYS.TENANT_VIRTUAL_SESSION_VARIABLEview (Oracle mode).
Modify variables
Global effect
Tenants can modify global system variables directly.
For V4.x, tenants of the Oracle mode can modify global system variables only with the
ALTER SYSTEMprivilege starting from V4.2.0.
Session effect
Tenants can modify session system variables of their own directly.
Attribute description
| Attribute | Description |
|---|---|
| Parameter type | Varchar |
| Default value | DD-MON-RR |
| Effect scope |
|
| Modifiable | Yes. You can modify this variable 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';