Query user_source for procedure declaration : user_source « System Tables Data Dictionary « Oracle PL/SQL Tutorial






SQL>
SQL> CREATE OR REPLACE PROCEDURE compile_error AS
  2       myDateTime timestamp;
  3  BEGIN
  4     SELECT systimestamp INTO myDateTime FROM dual;
  5     DBMS_OUTPUT.PUT_LINE(myDateTime);
  6  EXCEPTION
  7     WHEN OTHERS
  8     THEN
  9        DBMS_OUTPUT.PUT_LINE(SQLERRM);
 10  END;
 11  /

Procedure created.

SQL>
SQL>
SQL> SELECT line||' '||text PROCEDURE FROM user_source WHERE name = 'COMPILEERROR';

PROCEDURE
--------------------------------------------------------------------------------
1 PROCEDURE CompileError
2    AS
3      v_timestamp timestamp;
4 BEGIN
5    SELECT systimestamp
6    INTO v_timestamp
7    FROM dual;
8
9    DBMS_OUTPUT.PUT_LINE(v_timestamp);
10 EXCEPTION
11    WHEN OTHERS
12    THEN
13       DBMS_OUTPUT.PUT_LINE(SQLERRM);
14 END;

14 rows selected.

SQL>








30.97.user_source
30.97.1.Select the source code from USER_SOURCE
30.97.2.Get source code of procedure and function
30.97.3.Query the Oracle data dictionary view USER_SOURCE
30.97.4.When you do a search in the Oracle data dictionary, all object names are in uppercase
30.97.5.Query user_source for procedure declaration