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

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

What is this SQL for, take a guess?

From: Ethan Post <post.ethan_at_gmail.com>
Date: Thu, 16 Mar 2006 00:48:41 -0600
Message-ID: <357b48a90603152248u1930fb31v86334eae7a5824b0@mail.gmail.com>


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'

--
http://www.freelists.org/webpage/oracle-l
Received on Thu Mar 16 2006 - 00:48:41 CST

Original text of this message

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