如果使用 dbms_crypto 包下的函数

来源:互联网 发布:那个软件可以答题 编辑:程序博客网 时间:2024/05/16 08:10

用 sysdba 用户登录

sqlplus "/as sysdba"

执行如下语句进行 dbms_crypto 包赋权

grant execute on dbms_crypto to dls_0608_tl;

 

例子

begin

for x in(select deptno,dname,loc from dept where deptno = 9)

loop

dbms_output.put_line('Dname:'||x.dname);

dbms_output.put_line('Loc:'||x.loc);

dbms_output.put_line('Hash:'||dbms_crypto.Hash(utl_raw.cast_to_raw(x.deptno||'/'||x.dname||'/'||x.loc),dbms_crypto.HASH_SH1));

end loop;

end;