• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 785
  • Last Modified:

View/Stored Procedure Contents

Does anyone know how to spit out the contents of a view and stored procedure using an sql statement?  I can't use Oracle's SQL scratchpad.

Oracle 10g is database being used.
0
lcor
Asked:
lcor
  • 2
3 Solutions
 
lcorAuthor Commented:
this way, I can see code inside view, procedure
0
 
slightwv (䄆 Netminder) Commented:
all source can be queried from DBA_SOURCE.

select text from dba_source where name='SOMEPROCEDURE' order by line;

If you have several objects there is an TYPE column in that view.
0
 
sventhanCommented:
You can user dba_views, all_views to get the view code
0
 
sventhanCommented:
elect 'create or replace '||text,line
from
 dba_source
where
 owner = upper('&&owner') and
 type = upper('&&obj_type') and
 name = upper('&&obj_name') and
 line = 1
UNION
select text,line
from
 dba_source s2
where
 s2.name = upper('&&3') and
 s2.owner = upper('&&1') and
 s2.type = upper('&&2') and
 s2.line > 1
order by 2;

http://dba-oracle.com/t_display_oracle_stored_procedures.htm
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now