如何从VB.NET中调用oracle中的函数 [英] How to call the function in oracle from VB.NET

查看:246
本文介绍了如何从VB.NET中调用oracle中的函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hi
i我在oracle中有这个功能

hi i am having this function in oracle

CREATE OR REPLACE FUNCTION plf_encrypt(al_password IN VARCHAR2) RETURN RAW IS

	
	RETURN dbms_crypto.hash(utl_raw.cast_to_raw(upper(al_password)), dbms_crypto.hash_sh1);

END;

i try to call this using vb.net and my vb.net but it will return a error

like this ORA-06550: line 1, column 15: PLS-00306: wrong number or types of arguments in call to 'PLF_ENCRYPT' ORA-06550: line 1, column 7: PL/SQL: Statement ignored



my vb.net code i s




  Dim parm As OracleParameter
                parm = New OracleParameter()
                parm.Direction = ParameterDirection.ReturnValue
                parm.OracleDbType = OracleDbType.Raw
                parm.Size = 5000
                cmd1.Parameters.Add(parm)

                Dim r_password1 As New OracleParameter("al_password", OracleDbType.Varchar2)
                r_password1.Direction = ParameterDirection.Input
                r_password1.Value = objBEL.password
                cmd.Parameters.Add(r_password1)

               

                'Dim returnvalue As New OracleParameter("pReturnValue", OracleDbType.Raw)
                'returnvalue.Direction = ParameterDirection.ReturnValue
                'returnvalue.Size = "200"
                ''returnvalue.Value = objBEL.password
                'cmd.Parameters.Add(returnvalue)
                cmd1.ExecuteNonQuery()

                Dim rt1 As String = ""
                'rt1 = cmd1.Parameters.Item("pReturnValue").Value
                rt1 = cmd1.Parameters(0).Value()
                con.Close()

What I have tried:

if anyone know what will be the exact problem reply

推荐答案

请按照以下链接了解如何解决问题以及可能导致问题的原因:

Oracle / PLSQL:ORA-06550错误消息 [ ^ ]

ORA-06550提示 [< a href =http://www.dba-oracle.com/t_ora_06550.htmtarget =_ blanktitle =New Window> ^ ]
Follow below links to find out how to resolve your issue and what can cause a problem:
Oracle / PLSQL: ORA-06550 Error Message[^]
ORA-06550 tips[^]


这篇关于如何从VB.NET中调用oracle中的函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆