Oracle:函数的全局命名空间限定符?
如何限定函数或过程调用以指示它 应该在全球范围内吗?我有自己的scn到scn时间戳() 在需要调用的默认全局函数的包中 同名Oracle:函数的全局命名空间限定符?,oracle,plsql,namespaces,Oracle,Plsql,Namespaces,如何限定函数或过程调用以指示它 应该在全球范围内吗?我有自己的scn到scn时间戳() 在需要调用的默认全局函数的包中 同名 create or replace package px as function scn_to_timestamp(scn number) return timestamp; end px; create or replace package body px as function scn_to_timestamp(scn number) return
create or replace package px as
function scn_to_timestamp(scn number) return timestamp;
end px;
create or replace package body px as
function scn_to_timestamp(scn number) return timestamp is
begin
-- how do I qualify this to refer to the global function?
return scn_to_timestamp(scn);
end;
end px;
更新:事实证明不存在“全局”函数,因为所有函数都存在于模式下。显示为全局的实际上是一个公共同义词,因此您只需使用导出函数的模式作为调用的前缀,在本例中:
return sys.scn_to_timestamp(scn);
只需使用模式名称来引用全局。 我使用了模式所有者
create or replace package px as
function scn_to_timestamp(scn number) return timestamp;
end px;
create or replace package body px as
function scn_to_timestamp(scn number) return timestamp is
begin
-- how do I qualify this to refer to the global function?
return sys.scn_to_timestamp(scn);
end;
end px;
谢谢scn_to_时间戳归sys所有,因此我进行了更新以反映。