Note
This variable is introduced since OceanBase Database V2.2.30.
Description
nls_date_format specifies the format of converting a date to a string and the format of implicitly converting a string to a date.
Applicability
This variable is valid only in the Oracle mode of OceanBase Database.
Permission requirements
Query variables
Global level
Both the
systenant and all user tenants can use theSHOW VARIABLESstatement or theSYS.TENANT_VIRTUAL_GLOBAL_VARIABLEview (Oracle mode) to view the values of Global system variables.Session level
Both the
systenant and all user tenants can use theSHOW VARIABLESstatement or theSYS.TENANT_VIRTUAL_SESSION_VARIABLEview (Oracle mode) to view the values of Session system variables.
Modify variables
Global level
The
systenant can directly modify the values of Global system variables.For V4.x versions, starting from V4.2.0, Oracle user tenants require the
ALTER SYSTEMprivilege to modify the values of Global system variables.
Session level
Both the
systenant and all user tenants can directly modify the values of Session system variables of their own tenant.
Attributes
| Attribute | Description |
|---|---|
| Type | Varchar |
| Default value | DD-MON-RR |
| Applicable scope |
|
| Modifiable | Yes. It can be modified using the SET statement. |
| Affect the plan | Yes |
Usage notes
The data type of start_date is DATE. The value of start_date is converted to text using the format model specified in the system variable NLS_DATE_FORMAT, and then the result is passed to the SQL text. The datetime format model can simply consist of text enclosed in double quotes.
Configuration examples
Set the format of 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';