Oracle:如何调用重载过程?
如何正确调用DBMS_OBFUSCATION_TOOLKIT.DESEncrypt
? (如果可能,不使用 PL/SQL)
select DBMS_OBFUSCATION_TOOLKIT.DESEncrypt('x','y') from dual;
不起作用,因为 DESEncrypt 已重载:
ORA-06553: PLS-307: Too many declarations of "DESENCRYPT" match this call
06553. 00000 - "PLS-%s: %s"
*Cause:
*Action:
有没有办法选择 DESENCRYPT 的一种实现(可能是 VARCHAR2 变体)来避免此错误?
How to properly call DBMS_OBFUSCATION_TOOLKIT.DESEncrypt
? (without using PL/SQL if possible)
select DBMS_OBFUSCATION_TOOLKIT.DESEncrypt('x','y') from dual;
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:
Is there a way to choose one implementation of DESENCRYPT (possibly the VARCHAR2 variant) to avoid this error?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
在 Oracle 11G 中,您可以使用这样的命名表示法:
我认为在早期版本的 Oracle 中不可能明确地调用这些函数,除非创建一个包装函数并调用它。
In Oracle 11G you can use named notation like this:
I don't think it is possible to call these functions unambiguously in earlier versions of Oracle, except by creating a wrapper function and calling that instead.
在这里,只需通过提供参数名称让它知道要使用哪个重载即可!
回报
注意,你的密钥至少需要8个字节:
您可以总是尝试使用包装函数(正如托尼建议的那样)
由于您使用的是 10g,您可能需要使用 DBMS_CRYPTO 包
http://www.stanford.edu /dept/itss/docs/oracle/10g/network.101/b10773/apdvncrp.htm
here you go, just let it know which overload to use by supplying the param names!
returns
note, your key needs to be at least 8 bytes:
You may always try it with a wrapper function (as tony suggested)
Since you are on 10g, you may want to use the DBMS_CRYPTO package
http://www.stanford.edu/dept/itss/docs/oracle/10g/network.101/b10773/apdvncrp.htm
这是使用旧版 dbms_obfuscation_toolkit 进行的加密/解密:
对于解密:
以及用法:
here's a crypt/decrypt using the older dbms_obfuscation_toolkit:
And for decrypt:
And usage: