• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 780
  • 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

Featured Post

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

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