Oracle数据库中SP和表之间的关系
oracle中sp和表之间的关系
sp-table
select t1.owner as powner,t1.name as pname
,case when t1.referenced_owner in ('sapcrdb','sapirdb') then t1.referenced_owner else t2.owner end as towner
,t1.referenced_name as tname
from all_dependencies t1
inner join all_tables t2
on t1.referenced_name=t2.table_name
where t1.type = 'procedure'
and t1.owner in ('sapcrdb','sapirdb')
and case when t1.referenced_owner in ('sapcrdb','sapirdb') then t1.referenced_owner else t2.owner end = t2.owner
and t1.referenced_type in ('table','view','synonym')
and t1.name='sap_ag_atc'
and t2.temporary='n'
sp-sp
select t1.owner as powner,t1.name as pname
,case when t1.referenced_owner in ('sapcrdb','sapirdb') then t1.referenced_owner else t2.owner end as towner
,t1.referenced_name as tname
from all_dependencies t1
inner join all_objects t2
on t1.referenced_name=t2.object_name
where t1.type = 'procedure'
and t1.owner in ('sapcrdb','sapirdb')
and case when t1.referenced_owner in ('sapcrdb','sapirdb') then t1.referenced_owner else t2.owner end = t2.owner
and t1.referenced_type in ('procedure','synonym')
and t2.object_type='procedure'
and t1.name='sap_ag_etl_01';
上一篇: 别装了,都把人家吓着了。