【TUNE_ORACLE】列出LOOP套LOOP的PL/SQL程式碼SQL參考

Attack_on_Jager發表於2021-08-04

實驗環境

搭建平臺:VMware Workstation

OS:RHEL 6.10

Grid&DB:Oracle 11.2.0.4


SQL參考

with x as

(select /*+ materialize */ owner,name,type,line,text,rownum rn from dba_source where

(upper(text) like '%END%LOOP%' or upper(text) like '%FOR%LOOP%'))

select a.owner, a.name, a.type

  from x a, x b

 where ((upper(a.text) like '%END%LOOP%' and

       upper(b.text) like '%END%LOOP%' and a.rn + 1 = b.rn) or

       (upper(a.text) like '%FOR%LOOP%' and

       upper(b.text) like '%FOR%LOOP%' and a.rn + 1 = b.rn))

   and a.owner = b.owner

   and a.name = b.name

   and a.type = b.type

   and a.owner = 'TEST';  --使用者名稱


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/69992972/viewspace-2785129/,如需轉載,請註明出處,否則將追究法律責任。

相關文章