SQL 错误:ORA-00955:名称已被 Oracle 函数中的现有对象使用
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/30705219/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Error: ORA-00955: name is already used by an existing object in Oracle Function
提问by Andrew
I have function which i am trying to compile and getting an error as Error: ORA-00955: name is already used by an existing object
. I am really not aware of this error and try to search for this issue but did not find any solution. I dont know is this related to any grant priviledges but i dont have priviledges issue to my schema tables.
我有一个函数,我试图编译它并得到一个错误为Error: ORA-00955: name is already used by an existing object
. 我真的不知道这个错误并尝试搜索这个问题,但没有找到任何解决方案。我不知道这是否与任何授予权限有关,但我的架构表没有权限问题。
create or replace FUNCTION "AK_CHECK"
-- PUBLIC
(ID Number) RETURN Number
IS
TYPE_ID Number := 0;
SUCCESS Number := 0;
S Number := 0;
BEGIN
SELECT ACTIVE(ID) + MANUAL(ID) INTO S FROM DUAL;
CASE S
WHEN 2 THEN
SELECT TYPE INTO TYPE_ID
FROM SALE_SUPPLY KD
WHERE KD.KPI_DEF_ID = ID;
END CASE;
END AK_CHECK;
回答by Patrick Hofman
You probably have another object with the same name (PERFORM_CHECK
).
您可能有另一个同名的对象 ( PERFORM_CHECK
)。
You can find it by quering user_objects
:
您可以通过查询找到它user_objects
:
select *
from user_objects
where object_name = 'PERFORM_CHECK'
Then drop it (replace TYPE_OF_OBJECT
by the type of the object from the above query):
然后删除它(用TYPE_OF_OBJECT
上面查询中的对象类型替换):
drop TYPE_OF_OBJECT perform_check