欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

Oracle数据库中SP和表之间的关系

程序员文章站 2023-11-02 18:33:10
oracle中sp和表之间的关系 sp-table select t1.owner as powner,t1.name as pname ,case when t1.referenced_owner...

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';