Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Viewing Stored Procedures

Status
Not open for further replies.

HavaTheJut

Programmer
Jun 26, 2001
93
US
How do I view a packaged stored procedure in order to see the source code? A simple select statement didn't work (as I expected). Is there any way to view the code from the console, or do I have to use other means?
Thanks.
 
SELECT text
FROM dba_source
WHERE name = 'MY_PROCEDURE_NAME'
AND type = 'MY_PROCEDURE_TYPE'
ORDER BY line;
 
Thank you carp. I can get to the procedures that are not packaged, but how do I view those inside of a package?
 
SELECT text
FROM all_source
WHERE name = 'MY_PROCEDURE_NAME'
AND type = 'MY_PROCEDURE_TYPE' /* is PACKAGE BODY in your case */
ORDER BY line; I tried to remain child-like, all I acheived was childish.
 
Right - something like
SELECT text
FROM dba_source -- or all_source or user_source
WHERE name = 'DBMS_RANDOM'
AND type = 'PACKAGE BODY';
 
Don't forget about ORDER BY LINE. It's quite unusual, but Oracle MAY return rows in wrong order without this clause.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top