This discussion is archived
5 Replies Latest reply: Jun 28, 2013 8:13 AM by 9423755 RSS

Conditional compilation: "If the $$id cannot be resolved to a value, then the PLW-6003 warning message is reported"

9423755 Explorer
Currently Being Moderated

Hi,

So according to the documentation:

 

Using Conditional Compilation Inquiry Directives

The inquiry directive is used to check the compilation environment. The inquiry directive is of the form:

inquiry_directive ::= $$id

An inquiry directive can be predefined as described in "Using Predefined Inquiry Directives With Conditional Compilation" or be user-defined. The following describes the order of the processing flow when conditional compilation attempts to resolve an inquiry directive:

  1. The id is used as an inquiry directive in the form $$id for the search key.
  2. The two-pass algorithm proceeds as follows:The string in the PLSQL_CCFLAGS initialization parameter is scanned from right to left, searching with id for a matching name (case insensitive); done if found.The predefined inquiry directives are searched; done if found.
  3. If the $$id cannot be resolved to a value, then the PLW-6003 warning message is reported if the source text is not wrapped. The literal NULL is substituted as the value for undefined inquiry directives. Note that if the PL/SQL code is wrapped, then the warning message is disabled so that the undefined inquiry directive is not revealed.

 

I take this to mean, if you do $IF $$XXX = 5 $THEN .. $END but have not defined $$XXX with "alter session set plsql_ccflags" then you should expect an error.

But I am unable to make this trigger a warning or an error, either by

 

alter session set plsql_warnings = 'error:06003';

or

alter session set plsql_warnings = 'enable:all';

 

test setup:

 

SCOTT@ORCL> alter session set plsql_ccflags = '';
Session altered.
SCOTT@ORCL> alter session set plsql_warnings = 'enable:all', 'error:06003';
Session altered.
BEGIN
    $IF $$DEBUGON $THEN
        dbms_output.put_line('debug is on');
    $ELSIF NOT $$DEBUGON $THEN
        dbms_output.put_line('debug is NOT on');
    $ELSE
        dbms_output.put_line('debug is neither on nor off - DEBUGON IS NOT SET!');
    $END
   
END;
/
show errors
debug is neither on nor off - DEBUGON IS NOT SET!
PL/SQL procedure successfully completed.
No errors.
SCOTT@ORCL>

 

I am missing something; it is late after all; thanks

Jason

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points