Tuesday 12 February 2008

Finding Tables References Inside PL/SQL Store Procedure

The Oracle data dictionary tracks the object types referenced in PL/SQL with the dba_dependencies view. To track the dependency among packages and tables, try this dictionary query:

select
referenced_owner,
referenced_name,
referenced_type
from
dba_dependencies
where
name= 'MY_STORE_PROC'
and
owner = 'SCOTT'
order by
referenced_owner, referenced_name, referenced_type;
you can also select the referenced_type, ie. tables