本文介绍了Oracle:如何调用重载过程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何正确调用 DBMS_OBFUSCATION_TOOLKIT.DESEncrypt ? (如果可能,不使用PL / SQL)

How to properly call DBMS_OBFUSCATION_TOOLKIT.DESEncrypt? (without using PL/SQL if possible)

select DBMS_OBFUSCATION_TOOLKIT.DESEncrypt('x','y') from dual;

因为DESEncrypt重载不起作用:

doesn't work because DESEncrypt is overloaded:

ORA-06553: PLS-307: Too many declarations of "DESENCRYPT" match this call
06553. 00000 -  "PLS-%s: %s"
*Cause:
*Action:

有没有办法选择一个DESENCRYPT (可能是VARCHAR2变体)以避免这个错误?

Is there a way to choose one implementation of DESENCRYPT (possibly the VARCHAR2 variant) to avoid this error?

推荐答案

这里你去,只是让它知道使用哪个重载param name!

here you go, just let it know which overload to use by supplying the param names!

select DBMS_OBFUSCATION_TOOLKIT.DesEncrypt(INPUT_STRING=>'11112abc',KEY_STRING=>'4578ccde')
from dual ;

返回

注意,您的密钥至少需要8个字节:

note, your key needs to be at least 8 bytes:






它具有包装功能(如tony所示)


You may always try it with a wrapper function (as tony suggested)

create or replace
function DesEncrypt(pinputString IN VARCHAR2 , pKeyString in VARCHAR2) RETURN varchar2
IS
BEGIN
return DBMS_OBFUSCATION_TOOLKIT.DesEncrypt(INPUT_STRING=>INPUTSTRING,KEY_STRING=>KEYSTRING);
END DesEncrypt;
/
select DesEncrypt('11112abc' , '4578ccde') from dual ;






由于你在10g,你可能想使用DBMS_CRYPTO包

这篇关于Oracle:如何调用重载过程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-22 16:35