Querying DBA_SOURCE
FranklinFaces.com
FranklinFaces.com - Oracle & SQL Server Database Forums for all IT Professionals
 Home          Members     Calendar     Who's On

Welcome Guest ( Login | Register )
        



Querying DBA_SOURCE Expand / Collapse
Message
Posted 2/19/2009 4:30:28 PM Post #84
 

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being
I didn't have TOAD or any GUI utility in my laptop and I needed to view the source of a procedure. Now we all know how difficult it can be do view the source in DBA_SOURCE view. The output can be horrible and you'll never know what you're looking at if you don't format it properly.


Here is a quick outline to help you get a better output from DBA_SOURCE view.


SQL>
SQL>
SQL>
SQL> set feedback on
SQL> set heading off
SQL> set termout off
SQL> set linesize 1000
SQL> set trimspool on
SQL> set verify off
SQL>
SQL> select decode( type||'-'||to_char(line,'fm99999'),
2 'PACKAGE BODY-1', '/'||chr(10),
3 null) ||
4 decode(line,1,'create or replace ', '' ) ||
5 text text
6 from dba_source
7 where name = '';



You can adjust the output based on your linesize and pagesize.

Good luck.

Thanks,
« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: silencer

Permissions Expand / Collapse

All times are GMT -5:00, Time now is 7:34am

Powered By InstantForum.NET v4.1.4 © 2010
Execution: 0.066. 6 queries. Compression Disabled.