表->通过虚拟列的函数依赖不在 all_dependencies 中?
我有以下对象:
CREATE FUNCTION CONSTFUNC RETURN INT
DETERMINISTIC
AS
BEGIN
RETURN 1;
END;
CREATE TABLE "FUNCTABLE" (
"ID" NUMBER(*,0) NOT NULL,
"VIRT" NUMBER GENERATED ALWAYS AS ("CONSTFUNC"()) NULL
);
但是, functable => constfunc 依赖项未在 all_ 或 user_ 依赖项中列出。我可以在任何地方访问字典中的依赖关系信息吗?
I've got the following objects:
CREATE FUNCTION CONSTFUNC RETURN INT
DETERMINISTIC
AS
BEGIN
RETURN 1;
END;
CREATE TABLE "FUNCTABLE" (
"ID" NUMBER(*,0) NOT NULL,
"VIRT" NUMBER GENERATED ALWAYS AS ("CONSTFUNC"()) NULL
);
however, the functable => constfunc dependency is not listed in all_ or user_ dependencies. Is there anywhere I can access this dependency information in the dictionary?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我刚刚在 11G (11.1) 中创建了您的函数和表,可以确认您的发现。我在 Oracle 文档中也找不到任何内容。
如果删除该函数,表状态仍为“VALID”,但当您从表中进行选择时,您会收到 ORA-00904:“CHAMP”。“CONSTFUNC”:无效标识符。这表明 Oracle 本身并不知道这种依赖性。
也许值得在asktom.oracle.com 上提出这个问题,因为Tom Kyte 将能够访问更多信息——如果需要,他甚至可能会提出有关该问题的错误。
I just created your function and table in 11G (11.1) and can confirm your findings. I couldn't find anything in the Oracle docs either.
If you drop the function, the table status remains "VALID", but when you select from the table you get ORA-00904: "CHAMP"."CONSTFUNC": invalid identifier. This suggests that Oracle itself isn't aware of the dependency.
It might be worth asking this question on asktom.oracle.com, because Tom Kyte will have access to more information - he may even raise a bug about it if need be.
用于生成虚拟列的表达式列在 [DBA|ALL|USER]_TAB_COLUMNS 视图的 DATA_DEFAULT 列中。
The expression used to generate the virtual column is listed in the DATA_DEFAULT column of the [DBA|ALL|USER]_TAB_COLUMNS views.