Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

View code inside procedure in SQL developer

I have a procedure in SQL developer and I want to view what is written inside that procedure..how should I do it?

I am unable to see the code written inside the procedure but I am able to see the procedure structure when I run the query desc schema name.procedure name

Any help is appreciated..

like image 841
Manoj Thambe Avatar asked Oct 23 '25 23:10

Manoj Thambe


2 Answers

You can use the connections tab which is in the left side of sql developer.

Click the + icon near schema name then + near procedure as shown in the pic.Under that you will have all the existing procedure. You can click any of it to view

enter image description here

like image 98
Arun Palanisamy Avatar answered Oct 26 '25 23:10

Arun Palanisamy


SQL Developer

Browse to the connection name in the connections tab, expand the required object and just click, it will open the code in new tab.

ALL|USER|DBA_SOURCE view

Alternatively, you could query the DBA_SOURCE view:

SELECT text
FROM user_source
WHERE owner='<owner_name>'
AND name   ='<procedure_name>'
AND type   ='PROCEDURE';

make sure you put the owner_name and procedure_name in UPPER case, or in the exact case if you created using double-quotation marks.

like image 37
Lalit Kumar B Avatar answered Oct 26 '25 22:10

Lalit Kumar B