【发布时间】:2011-08-01 12:47:35
【问题描述】:
我正在寻找 PL/SQL 中的哈希函数,以获取 varchar 的哈希值。我在 Oracle 10 中找到了一个名为 dbms_crypto 的包,其中包含一个函数 dbms_crypto.hash 甚至其他包 dbms_sqlhash.getHash,但是在我调用它们的地方,我收到一条消息,好像它找不到它们......
有人知道我怎么称呼他们吗?有没有其他的包?
这是我的代码
DECLARE
l_textToHash VARCHAR2(19) := 'toto123';
l_ccn_raw RAW(128) := utl_raw.cast_to_raw(l_textToHash);
l_encrypted_raw RAW(2048);
BEGIN
dbms_output.put_line('CC: ' || l_ccn_raw);
l_encrypted_raw := dbms_crypto.hash(l_ccn_raw, 3);
dbms_output.put_line('SH1: ' || l_encrypted_raw);
END;
/
这是消息
Error starting at line 1 in command:
DECLARE
l_textToHash VARCHAR2(19) := 'toto123';
l_ccn_raw RAW(128) := utl_raw.cast_to_raw(l_textToHash);
l_encrypted_raw RAW(2048);
BEGIN
dbms_output.put_line('CC: ' || l_ccn_raw);
l_encrypted_raw := dbms_crypto.hash(l_ccn_raw, 3);
dbms_output.put_line('SH1: ' || l_encrypted_raw);
END;
Error report:
ORA-06550: line 7, column 22:
PLS-00201: identifier 'DBMS_CRYPTO' must be declared
ORA-06550: line 7, column 3:
PL/SQL: Statement ignored
06550. 00000 - "line %s, column %s:\n%s"
*Cause: Usually a PL/SQL compilation error.
*Action:
谢谢!
【问题讨论】:
-
你能描述一下吗?: desc dbms_crypto;将归 SYS 所有
标签: oracle hash plsql oracle-sqldeveloper