Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: What is this SQL for, take a guess?

Re: What is this SQL for, take a guess?

From: rjamya <rjamya_at_gmail.com>
Date: Thu, 16 Mar 2006 07:24:18 -0500
Message-ID: <9177895d0603160424l587fb7cepf55cba50a9a792f3@mail.gmail.com>


it probably lists the procedure/function _names_ in your source code.

Raj

On 3/16/06, Ethan Post <post.ethan_at_gmail.com> wrote:
>
>
>
> I am pretty proud of this little bitty. Anyone want to take a swipe what it
> could be used for? Oh and it will up in 'ur quest spotlight right out.
>
>
>
> select name, next_line, t from (
>
> select name, line, lead(line, 1) over (order by name, line) next_line, t,
> lead(t, 1) over (order by name, line) t1 from (
>
> select name, type, line, decode(instr(t, ' '), 0, t, substr(t,1,instr(t,'
> '))) t from (
>
> select name, type, line,
> trim(decode(substr(t,1,8),'FUNCTION',substr(t,10), t)) t
> from (
> select name, type, line,
> decode(substr(t,1,9),'PROCEDURE',substr(t,11), t) t from (
> (select name, type, line,
> replace(upper(trim(translate(text,'('||chr(10)||chr(13)||chr(9),'
> '))), ' ', ' ') t
> from all_source where owner='SCOTT'
> and type not in ('PACKAGE','TRIGGER'))
> ) where (t not like '%CODE AND ALTERNATE PROCEDURE/REV CODE.%')
> and(t like 'PROCEDURE %' or t like 'BEGIN' or t like 'FUNCTION %')
> )))) where t <> 'BEGIN' and t1='BEGIN'
>
>

Raj

--
----------------------------------------------
Got RAC?
--
http://www.freelists.org/webpage/oracle-l
Received on Thu Mar 16 2006 - 06:24:18 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US