Solved

View/Stored Procedure Contents

Posted on 2011-02-23
4
768 Views
Last Modified: 2012-06-22
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
Comment
Question by:lcor
  • 2
4 Comments
 

Author Comment

by:lcor
ID: 34964826
this way, I can see code inside view, procedure
0
 
LVL 76

Accepted Solution

by:
slightwv (䄆 Netminder) earned 167 total points
ID: 34964851
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
 
LVL 18

Assisted Solution

by:sventhan
sventhan earned 333 total points
ID: 34964862
You can user dba_views, all_views to get the view code
0
 
LVL 18

Assisted Solution

by:sventhan
sventhan earned 333 total points
ID: 34964884
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

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Never store passwords in plain text or just their hash: it seems a no-brainier, but there are still plenty of people doing that. I present the why and how on this subject, offering my own real life solution that you can implement right away, bringin…
As technology users and professionals, we’re always learning. Our universal interest in advancing our knowledge of the trade is unmatched by most industries. It’s a curiosity that makes sense, given the climate of change. Within that, there lies a…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question