3 Replies Latest reply on Sep 9, 2012 9:13 PM by MikeOBI

    Why is text header removed on compilation?

    MikeOBI
      Hi,
      I have a text header on my functions/procedures/packages, with standard stuff like name, developer, version history etc. When I open the file in SQL developer and compile my object, the text section at the top is removed? Anyone know why this is happening?

      Thanks,

      Mike
        • 1. Re: Why is text header removed on compilation?
          Jeff Smith Sqldev Pm-Oracle
          Is it before the 'CREATE OR REPLACE'?

          If so, it's not actually part of your PL/SQL object. The database only considers the text starting with the CREATE and ending with the END as part of the object.

          You can query user_source to confirm.


          Of course if it's not before the CREATE, an example of what you're experiencing would help us diagnose this.
          • 2. Re: Why is text header removed on compilation?
            rp0428
            >
            I have a text header on my functions/procedures/packages, with standard stuff like name, developer, version history etc. When I open the file in SQL developer and compile my object, the text section at the top is removed? Anyone know why this is happening?
            >
            Yes - if you put comments before or after the function/procedure/package it is not part of the function/procedure/package; it is just a comment.

            Only the text that is part of the definition is saved in the data dictionary.
            The comment below WILL NOT not be saved in the data dictionary.
            /**
               this comment is BEFORE the function declaration and IS NOT part of the function
            */
            CREATE OR REPLACE FUNCTION SCOTT.get_emp1( p_ename in emp1.ename%type )
            RETURN VARCHAR2
              as
              begin
                dbms_output.enable(20000);
                dbms_output.put_line('Value provided was ' || p_ename);
            --    dbms_output.disable();
                RETURN p_ename;
              end;
            /
            The comment below WILL be saved in the data dictionary.
            CREATE OR REPLACE FUNCTION SCOTT.get_emp1( p_ename in emp1.ename%type )
            RETURN VARCHAR2
              as
            /**
               this comment is AFTER the function declaration and IS part of the function
            */
              begin
                dbms_output.enable(20000);
                dbms_output.put_line('Value provided was ' || p_ename);
            --    dbms_output.disable();
                RETURN p_ename;
              end;
            /
            1 person found this helpful