Note
This variable is available starting with V4.0.0.
Description
cursor_sharing specifies whether to parameterize SQL statements.
Privilege requirements
Query variables
Global level
You can execute the
SHOW VARIABLESstatement or query theSYS.TENANT_VIRTUAL_GLOBAL_VARIABLEview (Oracle mode) or theinformation_schema.GLOBAL_VARIABLESview (MySQL mode) to view the value of a Global system variable in thesystenant and all user tenants.Session level
You can execute the
SHOW VARIABLESstatement or query theSYS.TENANT_VIRTUAL_SESSION_VARIABLEview (Oracle mode) or theinformation_schema.SESSION_VARIABLESview (MySQL mode) to view the value of a Session system variable in thesystenant and all user tenants.
Modify variables
Global level
In the
systenant, you can directly modify the value of a Global system variable.In a MySQL user tenant, you must have the
SUPERorALTER SYSTEMprivilege to modify the value of a Global system variable.In an Oracle user tenant, you must have the
ALTER SYSTEMprivilege to modify the value of a Global system variable.
Session level
You can directly modify the value of a Session system variable in the
systenant and all user tenants.
Attributes
| Attribute | Description |
|---|---|
| Type | enum |
| Default value | FORCE |
| Value range |
|
| Scope |
|
| Modifiable | Yes. You can execute the SET statement to modify the value. |
Examples
Parameterize SQL statements.
Global level
obclient> SET GLOBAL cursor_sharing ='FORCE';Session level
obclient> SET cursor_sharing ='FORCE';
