Note
This variable was introduced in OceanBase Database V4.0.0_CE.
Description
plsql_ccflags specifies the compilation constants of the Procedural Language (PL) compiler. It controls conditional judgment in conditional compilation.
Applicability
This variable is applicable to only OceanBase Database in Oracle mode.
Attributes
| Attribute | Description |
|---|---|
| Type | Varchar |
| Default value | N/A |
| Value range | Strings that conform to the specifications of the PL compiler. |
| Effective scope |
|
| Modifiable | Yes. You can use the SET statement to modify the variable. |
Considerations
You must specify the plsql_ccflags variable in the format of plsql_ccflags='<v1>:<c1>,<v2>:<c2>,...,<vn>:<cn>'. The items in the format are described as follows:
vi: a PL/SQL identifier, which is case-insensitive and can be a reserved keyword.ci: the value ofvi, which is case-insensitive and can be a Boolean, PLS_INTEGER, or NULL value.
Examples
Set the plsql_ccflags variable to specify the conditional compilation identifiers v_t, v_f, and v_1, as well as their corresponding values true, false, and 6. If the value of v_f is not null, the DBMS_OUTPUT.PUT_LINE statement is executed to return information.
Set the variable at the 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; /Set the variable at the 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; /