Oracle 中的哈希字符串
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9929290/
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
Hashing string in Oracle
提问by BRabbit27
I know there's a function to obtain the hash value from a varchar in Oracle, but when I run the query to see the returned value it sends the following message.
我知道有一个函数可以从 Oracle 中的 varchar 获取哈希值,但是当我运行查询以查看返回值时,它会发送以下消息。
ORA-00904: : identificador no válido
00904. 00000 - "%s: invalid identifier"
*Cause:
*Action:
Error en la línea: 70, columna: 7
What I'm doing is the following:
我正在做的是以下内容:
select DBMS_CRYPTO.hash(utl_raw.cast_to_raw('Foo'), 3) FROM dual;
It should return the SHA-1 of the string.
它应该返回字符串的 SHA-1。
回答by Justin Cave
That works for me
这对我行得通
SQL> select DBMS_CRYPTO.hash(utl_raw.cast_to_raw('Foo'), 3) FROM dual;
DBMS_CRYPTO.HASH(UTL_RAW.CAST_TO_RAW('FOO'),3)
--------------------------------------------------------------------------------
201A6B3053CC1422D2C3670B62616221D2290929
Are you sure that the user that is running this has been granted EXECUTE
access on both the UTL_RAW
and the DBMS_CRYPTO
packages? If line 70 of your code is this SELECT
statement, I'd wager that column 7 is where the DBMS_CRYPTO
call starts and that you don't have access to the DBMS_CRYPTO
package.
您确定运行此程序的用户已被授予EXECUTE
对UTL_RAW
和DBMS_CRYPTO
包的访问权限吗?如果您的代码的第 70 行是这个SELECT
语句,我敢打赌第 7 列是DBMS_CRYPTO
调用开始的地方,并且您无权访问该DBMS_CRYPTO
包。