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
The variable applies only to OceanBase Database's Oracle-compatible mode.
Privilege requirements
Query variables
Global level
Both the
systenant and all user tenants can execute theSHOW VARIABLESstatement or query theSYS.TENANT_VIRTUAL_GLOBAL_VARIABLEview (in Oracle-compatible mode) to query the values of global system variables.Session level
Both the
systenant and all user tenants can execute theSHOW VARIABLESstatement or query theSYS.TENANT_VIRTUAL_SESSION_VARIABLEview (in Oracle-compatible mode) to query the values of session system variables.
Modify variables
Global level
Tenants can modify global system variables directly.
Oracle-compatible tenants can modify global system variables only with the
ALTER SYSTEMprivilege.
Session level
Both the
systenant and all user tenants can directly modify the values of session system variables for their own tenant.
Attributes
| Attribute | Description |
|---|---|
| Parameter type | Varchar |
| Default value | DD-MON-RR |
| Effect scope |
|
| Modifiable | Yes. You can modify it by using the SET statement. |
Considerations
The data type of start_date is DATE. Its value is converted to text using the format model specified by the system variable NLS_DATE_FORMAT, and the result is then passed into the SQL text. A datetime format model can simply consist of text enclosed in double quotation marks.
Configuration examples
Set the format for converting a date to a string to DD-MON-RR.
Session level
obclient> SET nls_date_format='DD-MON-RR';Global level
obclient> SET GLOBAL nls_date_format='DD-MON-RR';