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-compatible mode.
Privilege requirements
Query variables
Global level
systenant and all user tenants can execute theSHOW VARIABLESstatement or query theSYS.TENANT_VIRTUAL_GLOBAL_VARIABLE(Oracle-compatible mode) orinformation_schema.GLOBAL_VARIABLES(MySQL-compatible mode) view to view the values of global system variables.Session level
systenant and all user tenants can execute theSHOW VARIABLESstatement or query theSYS.TENANT_VIRTUAL_SESSION_VARIABLE(Oracle-compatible mode) orinformation_schema.SESSION_VARIABLES(MySQL-compatible mode) view to view the values of session system variables.
Modify variables
Global level
systenant can directly modify the values of global system variables.MySQL user tenants must have the
SUPERorALTER SYSTEMprivilege to modify the values of global system variables.Oracle user tenants must have the
ALTER SYSTEMprivilege to modify the values of global system variables.
Session level
systenant and all user tenants can directly modify the values of session system variables.
Attributes
| Attribute | Description |
|---|---|
| Parameter type | varchar |
| Value range | A string that conforms to the PL Compiler specification. |
| Scope |
|
| Modifiable | Yes. You can execute the SET statement to modify the value. |
Usage
The syntax of plsql_ccflags is as follows: plsql_ccflags= '<v1>:<c1>,<v2>:<c2>,...,<vn>:<cn>' where:
- vi is a PL/SQL identifier, case-insensitive, and can be a reserved keyword.
- ci is the value of vi, which can be a Boolean, pls_integer, or NULL value, and is case-insensitive.
Examples
Set plsql_ccflags to specify the conditional compilation flags and their corresponding values. For example, set v_t to true, v_f to false, and v_1 to 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; /