Oracle
 sql >> Database >  >> RDS >> Oracle

Come elencare tutte le tabelle utilizzate in una particolare procedura memorizzata in Oracle

Dynamic SQL s vengono ignorati, poiché non sono convalidati in SEMANTIC controlli durante le compilazioni

select 
   proc_syn.referenced_owner, 
   proc_syn.referenced_name, 
   proc_syn.referenced_type,
   syn_tab.table_name
from 
   dba_dependencies proc_syn, dba_synonyms syn_tab, dba_tables tables
where 
     proc_syn.name= 'YOUR_PROC' 
  AND REFERENCED_TYPE in ( 'SYNONYM','TABLE')
  AND proc_syn.referenced_name = syn_tab.synonym_name
  AND syn_tab.synonym_name = tables.table_name
  AND syn_tab.owner = 'PUBLIC'
order by 
  proc_syn.referenced_owner, syn_tab.table_name;