Note
This variable is available starting with V4.0.0_CE.
Description
plsql_ccflags specifies the conditional compilation flags.
Applicability
This variable applies only to OceanBase Database in Oracle mode.
Privilege requirements
Query variables
Global level
systenant and all user tenants can query the value of a global system variable by executing theSHOW VARIABLESstatement or querying theSYS.TENANT_VIRTUAL_GLOBAL_VARIABLEview (Oracle mode) or theinformation_schema.GLOBAL_VARIABLESview (MySQL mode).Session level
systenant and all user tenants can query the value of a session system variable by executing theSHOW VARIABLESstatement or querying theSYS.TENANT_VIRTUAL_SESSION_VARIABLEview (Oracle mode) or theinformation_schema.SESSION_VARIABLESview (MySQL mode).
Modify variables
Global level
systenant can directly modify the value of a global system variable.MySQL user tenants must have the
SUPERorALTER SYSTEMprivilege to modify the value of a global system variable.Oracle user tenants must have the
ALTER SYSTEMprivilege to modify the value of a global system variable.
Session level
systenant and all user tenants can directly modify the value of a session system variable.
Attributes
| Attribute | Description |
|---|---|
| Type | Varchar |
| Value range | A string that complies with the PL Compiler specification |
| Scope |
|
| Modifiable | Yes. You can execute the SET statement to modify the value. |
Usage
The value of plsql_ccflags is specified in the plsql_ccflags= '<v1>:<c1>,<v2>:<c2>,...,<vn>:<cn>' format, where:
- vi is a PL/SQL identifier that is case-insensitive and can be a reserved keyword.
- ci is the value corresponding to vi. It can be a Boolean, pls_integer, or NULL value, and is case-insensitive.
Examples
Set plsql_ccflags to specify that the conditional compilation identifier v_t has the value true, the identifier v_f has the value false, and the identifier v_1 has the value 6. If v_f is not null, the DBMS_OUTPUT.PUT_LINE statement is executed to output information.
Session level
obclient> ALTER SESSION SET plsql_ccflags = 'v_t:true,v_f:false,v_1:6'; create or replace function my_func return number is begin $if $$v_f is not null $then DBMS_OUTPUT.PUT_LINE('$$PLSQL_UNIT = ' || $$PLSQL_UNIT); DBMS_OUTPUT.PUT_LINE('$$PLSQL_UNIT_OWNER = ' || $$PLSQL_UNIT_OWNER); $end return 200; end; /Global level
obclient> SET GLOBAL plsql_ccflags = 'v_t:true,v_f:false,v_1:6'; create or replace function my_func return number is begin $if $$v_f is not null $then DBMS_OUTPUT.PUT_LINE('$$PLSQL_UNIT = ' || $$PLSQL_UNIT); DBMS_OUTPUT.PUT_LINE('$$PLSQL_UNIT_OWNER = ' || $$PLSQL_UNIT_OWNER); $end return 200; end; /