Forum Stats

  • 3,757,634 Users
  • 2,251,251 Discussions
  • 7,869,876 Comments

Discussions

Is there something special with lines that start with #?

Compile this procedure in:

create or replace procedure test_case is
  l_garbage varchar2(500);
BEGIN

    l_garbage := q'[
    #CT_TITLE#
    #CT_SUBTITLE_LINE1#
    #CT_SUBTITLE_LINE2#
    #CT_SUBTITLE_LINE3#
    #CT_TOP_RIGHT#
    ]';

    raise_application_error(-20001, 'What are you running this for? Want to see garbage? ' || l_garbage);
END;

The output of compiling this procedure is:

ERROR at line 1:
unknown command "CT_TITLE#" - rest of line ignored.
ERROR at line 1:
unknown command "CT_SUBTIT..." - rest of line ignored.
ERROR at line 1:
unknown command "CT_SUBTIT..." - rest of line ignored.
ERROR at line 1:
unknown command "CT_SUBTIT..." - rest of line ignored.
ERROR at line 1:
unknown command "CT_TOP_RI..." - rest of line ignored.
Procedure created.

If I then look at the procedure that now exists in the database, it is:

CREATE OR REPLACE procedure test_case is
  l_garbage varchar2(500);
BEGIN

    l_garbage := q'[
    ]';

    raise_application_error(-20001, 'What are you running this for? Want to see garbage? ' || l_garbage);
END;

So what happened with the #STRING# lines?

Answers