Oracle: how to view source code of stored procedure
September 13, 2008 20:52:47 Last update: September 15, 2008 23:04:35
The text source of the stored objects (including stored procedures) are made available in Oracle by three views:
These are the columns:
If you want to search for a certain keyword in the source, this query may be helpful:
Enter the string you are looking for when prompted for the value of
-
USER_SOURCEdescribes the text source of the stored objects owned by the current user. This view does not display the OWNER column. -
ALL_SOURCEdescribes the text source of the stored objects accessible to the current user. -
DBA_SOURCEdescribes the text source of all stored objects in the database.
These are the columns:
| Column Name | Description |
|---|---|
| OWNER | Owner of the object |
| NAME | Name of the object |
| TYPE | Type of object: FUNCTION, JAVA SOURCE, PACKAGE, PACKAGE BODY, PROCEDURE, TRIGGER, TYPE, TYPE BODY |
| LINE | Line number of this line of source |
| TEXT | Text source of the stored object |
If you want to search for a certain keyword in the source, this query may be helpful:
SELECT type, name, line FROM user_source WHERE UPPER(text) LIKE UPPER('%&SEARCH_STRING%');
Enter the string you are looking for when prompted for the value of
SEARCH_STRING.