Deliverables
New member
- Joined
- Apr 21, 2010
- Messages
- 2
- Programming Experience
- 5-10
Hello guys,
Firstly I must mention that am new to both vb.net and oracle. I come from a VB 6.0 and Microsoft SQL server background. I am building an online payment system which is external to our production database so I need to insert records into one table in the production database then call a stored function in oracle from vb.net which is supposed to process the records I inserted. I don't have permission to edit anything in the database so I cant change the function to a procedure like some help on other forums was suggesting. The developers of the database and core system which uses the database only game me the function name and parameters of the function to call. However, I am running into the error below when I call the function from vb.net:
-----------------------
vb.net: ORA-06550: line 1, column 18:
PLS-00382: expression is of wrong type
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
-------------------
My code is as below:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim Connection52 As OracleConnection
Connection52 = New OracleConnection("Data Source=Source;Persist Security Info=True;User ID=ID;PWD=pwd;Unicode=True")
Connection52.Open()
Dim cmd As New OracleCommand
cmd.Connection = Connection52
cmd.CommandText = "depks_upload.fn_batch_upload"
cmd.CommandType = CommandType.StoredProcedure
cmd.Parameters.Add("result", OracleType.Number).Value = DBNull.Value
cmd.Parameters("result").Direction = ParameterDirection.ReturnValue
cmd.Parameters.Add("p_branch", OracleType.VarChar).Value = "027"
cmd.Parameters.Add("p_appldate", OracleType.DateTime).Value = "31-Jul-2009"
cmd.Parameters.Add("p_curr_userid", OracleType.VarChar).Value = "SYSTEM"
cmd.Parameters.Add("p_batchno", OracleType.VarChar).Value = "5619"
cmd.Parameters.Add("p_source_code", OracleType.VarChar).Value = "LSKCLG"
cmd.Parameters.Add("p_ovd", OracleType.VarChar).Value = "N"
cmd.Parameters.Add("p_lcy", OracleType.VarChar).Value = "ZMK"
cmd.Parameters.Add("p_lang", OracleType.VarChar).Value = "ENG"
cmd.Parameters.Add("p_mis_required", OracleType.VarChar).Value = "N"
cmd.Parameters.Add("p_auto_auth", OracleType.VarChar).Value = "Y"
cmd.Parameters.Add("p_udf_upload", OracleType.VarChar).Value = "N"
cmd.Parameters.Add("p_gl_offset_entry", OracleType.VarChar).Value = "032"
cmd.Parameters.Add("p_txn_code", OracleType.VarChar).Value = "CAW"
cmd.Parameters.Add("p_offset_gl", OracleType.VarChar).Value = "032"
cmd.Parameters.Add("p_total_ent", OracleType.Number).Value = DBNull.Value
cmd.Parameters("p_total_ent").Direction = ParameterDirection.Output
cmd.Parameters.Add("p_ent_uploaded", OracleType.Number).Value = DBNull.Value
cmd.Parameters("p_ent_uploaded").Direction = ParameterDirection.Output
cmd.Parameters.Add("p_ent_rejected", OracleType.Number).Value = DBNull.Value
cmd.Parameters("p_ent_rejected").Direction = ParameterDirection.Output
cmd.Parameters.Add("p_error_code", OracleType.VarChar).Value = DBNull.Value
cmd.Parameters("p_error_code").Size = 50
cmd.Parameters("p_error_code").Direction = ParameterDirection.Output
cmd.Parameters.Add("p_error_parameter", OracleType.VarChar).Value = DBNull.Value
cmd.Parameters("p_error_parameter").Size = 50
cmd.Parameters("p_error_parameter").Direction = ParameterDirection.Output
' execute the function
cmd.ExecuteNonQuery()
End Sub
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Firstly I must mention that am new to both vb.net and oracle. I come from a VB 6.0 and Microsoft SQL server background. I am building an online payment system which is external to our production database so I need to insert records into one table in the production database then call a stored function in oracle from vb.net which is supposed to process the records I inserted. I don't have permission to edit anything in the database so I cant change the function to a procedure like some help on other forums was suggesting. The developers of the database and core system which uses the database only game me the function name and parameters of the function to call. However, I am running into the error below when I call the function from vb.net:
-----------------------
vb.net: ORA-06550: line 1, column 18:
PLS-00382: expression is of wrong type
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
-------------------
My code is as below:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim Connection52 As OracleConnection
Connection52 = New OracleConnection("Data Source=Source;Persist Security Info=True;User ID=ID;PWD=pwd;Unicode=True")
Connection52.Open()
Dim cmd As New OracleCommand
cmd.Connection = Connection52
cmd.CommandText = "depks_upload.fn_batch_upload"
cmd.CommandType = CommandType.StoredProcedure
cmd.Parameters.Add("result", OracleType.Number).Value = DBNull.Value
cmd.Parameters("result").Direction = ParameterDirection.ReturnValue
cmd.Parameters.Add("p_branch", OracleType.VarChar).Value = "027"
cmd.Parameters.Add("p_appldate", OracleType.DateTime).Value = "31-Jul-2009"
cmd.Parameters.Add("p_curr_userid", OracleType.VarChar).Value = "SYSTEM"
cmd.Parameters.Add("p_batchno", OracleType.VarChar).Value = "5619"
cmd.Parameters.Add("p_source_code", OracleType.VarChar).Value = "LSKCLG"
cmd.Parameters.Add("p_ovd", OracleType.VarChar).Value = "N"
cmd.Parameters.Add("p_lcy", OracleType.VarChar).Value = "ZMK"
cmd.Parameters.Add("p_lang", OracleType.VarChar).Value = "ENG"
cmd.Parameters.Add("p_mis_required", OracleType.VarChar).Value = "N"
cmd.Parameters.Add("p_auto_auth", OracleType.VarChar).Value = "Y"
cmd.Parameters.Add("p_udf_upload", OracleType.VarChar).Value = "N"
cmd.Parameters.Add("p_gl_offset_entry", OracleType.VarChar).Value = "032"
cmd.Parameters.Add("p_txn_code", OracleType.VarChar).Value = "CAW"
cmd.Parameters.Add("p_offset_gl", OracleType.VarChar).Value = "032"
cmd.Parameters.Add("p_total_ent", OracleType.Number).Value = DBNull.Value
cmd.Parameters("p_total_ent").Direction = ParameterDirection.Output
cmd.Parameters.Add("p_ent_uploaded", OracleType.Number).Value = DBNull.Value
cmd.Parameters("p_ent_uploaded").Direction = ParameterDirection.Output
cmd.Parameters.Add("p_ent_rejected", OracleType.Number).Value = DBNull.Value
cmd.Parameters("p_ent_rejected").Direction = ParameterDirection.Output
cmd.Parameters.Add("p_error_code", OracleType.VarChar).Value = DBNull.Value
cmd.Parameters("p_error_code").Size = 50
cmd.Parameters("p_error_code").Direction = ParameterDirection.Output
cmd.Parameters.Add("p_error_parameter", OracleType.VarChar).Value = DBNull.Value
cmd.Parameters("p_error_parameter").Size = 50
cmd.Parameters("p_error_parameter").Direction = ParameterDirection.Output
' execute the function
cmd.ExecuteNonQuery()
End Sub
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>