我使用此脚本查找my_package中的所有依赖项:
select * from all_dependencies where NAME='PK_PACKAGE'
但它只返回:
NAME TYPE REFERENCED_OWNER REFERENCED_NAME REFERENCED_TYPE REFERENCED_LINK_NAME DEPENDENCY_TYPE
PK_PACKAGE PACKAGE SYS STANDARD PACKAGE HARD
但是当我在TOAD上的包上按F4时,它会带来所有依赖项。所以蟾蜍如何找到它们。在哪个表?
提前致谢
答案 0 :(得分:2)
PK_package最有可能是PK_PACKAGE(全部大写)。
[经过一些研究后编辑]
如果您 - 在TOAD中 - 转到[数据库菜单 - 假脱机SQL - 假脱机SQL到屏幕],然后在该程序包的架构浏览器中单击“Deps(uses)”选项卡,您将得到如下内容:
Session: SCOTT@ORCL
Timestamp: 09:45:50.824
Select a.object_id, a.object_type, a.object_name,
b.owner ref_owner, b.object_type ref_type, b.object_name ref_name, b.object_id ref_id, b.status ref_status
from sys.ALL_OBJECTS a,
sys.ALL_OBJECTS b,
(Select object_id, referenced_object_id
from (select object_id, referenced_object_id
from public_dependency
where referenced_object_id <> object_id) pd
start with object_id = :ObjID
connect by prior referenced_object_id = object_id) c
where a.object_id = c.object_id
and b.object_id = c.referenced_object_id
and a.owner not in ('SYS', 'SYSTEM')
and b.owner not in ('SYS', 'SYSTEM')
and a.object_name <> 'DUAL'
and b.object_name <> 'DUAL'
:ObjID(INTEGER,IN/OUT)=2357633
这将是鼠标点击背后的查询所以 - 看看它,也许你会找到有用的东西。