oracle oracle中创建函数时权限不足
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10475620/
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
Insufficient privilege when creating a function in oracle
提问by kaushik
I have little knowledge on oracle. I tried to create a function like below.
我对oracle知之甚少。我试图创建一个如下所示的函数。
CREATE OR REPLACE FUNCTION "BOOK"."CONVERT_TO_WORD" (totpayable IN NUMBER) RETURN VARCHAR
AS
totlength NUMBER;
num VARCHAR2(14);
word VARCHAR2(70);
word1 VARCHAR2(8);
BEGIN
SELECT LENGTH(totpayable) INTO totlength FROM dual;
WHILE totlength>0
LOOP
SELECT SUBSTR(totpayable,totlength,1) INTO num FROM dual;
IF num='-' THEN
word1:='(Excess)';
END IF;
IF num='0' THEN
word1:='Zero';
END IF;
IF num='1' THEN
word1:='One';
END IF;
IF num='2' THEN
word1:='Two';
END IF;
IF num='3' THEN
word1:='Three';
END IF;
IF num='4' THEN
word1:='Four';
END IF;
IF num='5' THEN
word1:='Five';
END IF;
IF num='6' THEN
word1:='Six';
END IF;
IF num='7' THEN
word1:='Seven';
END IF;
IF num='8' THEN
word1:='Eight';
END IF;
IF num='9' THEN
word1:='Nine';
END IF;
word:=word1||' '||word;
totlength:=totlength-1;
END LOOP;
RETURN word;
END ;
when I try to execute it, I am getting errors as below:
当我尝试执行它时,出现如下错误:
ORA-01031: insufficient privileges
01031.00000 - "insufficient privileges"
*Cause: An attempt was made to change the current username or password without the appropriate privilege. This error also occurs if attempting to install a database without the necessary operating system privileges. When Trusted Oracle is configure in DBMS MAC, this error may occur if the user was granted the necessary privilege at a higher label than the current login.
ORA-01031: 权限不足
01031.00000 - “权限不足”
*原因:试图在没有适当权限的情况下更改当前用户名或密码。如果在没有必要的操作系统权限的情况下尝试安装数据库,也会发生此错误。在 DBMS MAC 中配置 Trusted Oracle 时,如果在比当前登录名更高的标签上授予用户必要的权限,则可能会发生此错误。
I have given privileges to the user using this command:
我已使用此命令授予用户权限:
grant all privilege to book;
grant all privilege to book;
回答by Satya
use grant create session to book;
and then create the procedure
使用grant create session to book;
然后创建过程
回答by haiyuanzhang
grant create procedure to book;
授予创建程序进行预订;