尽管获得了 GRANT EXECUTE,但我在函数调用中得到 "ORA-00904: invalid identifier"
I get "ORA-00904: invalid identifier" on function call despite being given GRANT EXECUTE
我正在尝试为 DSCRPT 用户名调用 IS_NUMBER 函数,但我必须在 DSCDBA 登录中创建该函数
我授予了 EXECUTE 权限,就像我对其他多个功能一样,但是这个会引发 INVALID IDENTIFIER 错误
函数:
create or replace
FUNCTION is_number (p_string IN VARCHAR2)
RETURN INT
IS
v_new_num NUMBER;
BEGIN
v_new_num := TO_NUMBER(p_string);
RETURN 1;
EXCEPTION
WHEN VALUE_ERROR THEN
RETURN 0;
END;
授予:
GRANT EXECUTE ON "DCSDBA"."IS_NUMBER" TO "DCSRPT";
以 DSCRPT
身份登录时执行 SQL
SELECT IS_NUMBER('123') FROM DUAL;
错误:
ORA-00904: "IS_NUMBER": invalid identifier
00904. 00000 - "%s: invalid identifier"
*Cause:
*Action: Error at Line: 1 Column: 8
已确认我可以在登录 DSCRPT 时看到该功能
SELECT * FROM ALL_OBJECTS WHERE OBJECT_TYPE IN ('FUNCTION') and owner = 'DCSDBA' order by owner, object_name;
Return of ALL_OBJECTS search
尝试拨打电话
SELECT DCSDBA.IS_NUMBER('123') FROM DUAL;
我正在尝试为 DSCRPT 用户名调用 IS_NUMBER 函数,但我必须在 DSCDBA 登录中创建该函数 我授予了 EXECUTE 权限,就像我对其他多个功能一样,但是这个会引发 INVALID IDENTIFIER 错误
函数:
create or replace
FUNCTION is_number (p_string IN VARCHAR2)
RETURN INT
IS
v_new_num NUMBER;
BEGIN
v_new_num := TO_NUMBER(p_string);
RETURN 1;
EXCEPTION
WHEN VALUE_ERROR THEN
RETURN 0;
END;
授予:
GRANT EXECUTE ON "DCSDBA"."IS_NUMBER" TO "DCSRPT";
以 DSCRPT
身份登录时执行 SQLSELECT IS_NUMBER('123') FROM DUAL;
错误:
ORA-00904: "IS_NUMBER": invalid identifier 00904. 00000 - "%s: invalid identifier" *Cause:
*Action: Error at Line: 1 Column: 8
已确认我可以在登录 DSCRPT 时看到该功能
SELECT * FROM ALL_OBJECTS WHERE OBJECT_TYPE IN ('FUNCTION') and owner = 'DCSDBA' order by owner, object_name;
Return of ALL_OBJECTS search
尝试拨打电话
SELECT DCSDBA.IS_NUMBER('123') FROM DUAL;