dotnetHanover
New member
- Joined
- Dec 22, 2010
- Messages
- 1
- Programming Experience
- 1-3
Does any have experience in VB.Net calling a Oracle stored procedure using an OUT Parameter and a OUT Result Set? I am getting values returned by the Result Set but not with the Out Parameter. I have verified by executing the procedure that values should be returned. The proc calls work in VB 6.0 version but do not after the .NET conversion. This code was converted with Artinsoft ADO wrappers. I appreciate any help or ideas.
The procedure Header
PROCEDURE ReceiveReadyOrders(
oV_Success OUT VARCHAR2,
oT_TIMOrderIdList OUT TIM_CRS_VB.gU_TIMNumberTableType,
oT_OrderTypeCdList OUT TIM_CRS_VB.gU_TIMVarchar20TableType,
oT_OrderStateCdList OUT TIM_CRS_VB.gU_TIMVarchar20TableType,
oT_ThurnallStateCd OUT TIM_CRS_VB.gU_TIMVarchar20TableType,
oT_ActionErrorCd OUT TIM_CRS_VB.gU_TIMVarchar20TableType,
oT_ActionErrorText OUT TIM_CRS_VB.gU_TIMVarchar200TableType
);
The parameter definition
TYPE gU_TIMVarchar20TableType IS TABLE OF VARCHAR2(20)
INDEX BY BINARY_INTEGER;
VB.NET with Artinsoft wrappers.
Dim strStoredProc As String = "{call tim_crs_vb.ReceiveReadyOrders(?," & _
"{resultset 2000, oT_TIMOrderIdList, " & _
"oT_OrderTypeCdList, " & _
"oT_OrderStateCdList, " & _
"oT_ThurnallStateCd, " & _
"oT_ActionErrorCd, " & _
"oT_ActionErrorText})}"
With cmdStoredProc
.Connection = dbTIMConnection
.CommandText = strStoredProc
.CommandType = CommandType.Text
' Create parameters in exact order as in the procedure
Dim TempParameter As DbParameter
TempParameter = .CreateParameter()
TempParameter.ParameterName = "pSuccess"
TempParameter.DbType = DbType.String
TempParameter.Direction = ParameterDirection.Output
TempParameter.Size = 600
TempParameter.Value = ""
.Parameters.Add(TempParameter)
'.Parameters.Append .CreateParameter("pErrorCode", adVarChar, adParamOutput, 20, "")
'.Parameters.Append .CreateParameter("pErrorText", adVarChar, adParamOutput, 200, "")
End With
' Execute the procedure
Dim recTables As ADORecordSetHelper = New ADORecordSetHelper("")
recTables.LockType = LockTypeEnum.adLockReadOnly
recTables = ADORecordSetHelper.Open(cmdStoredProc, "")
Results
It returns values for result set recTables, but Null for the Out parameter pSuccess. I have ran the stored procedure to verify that it should return results. The calls work in the VB 6.0 version but not with .NET conversion via Artinsoft.
The procedure Header
PROCEDURE ReceiveReadyOrders(
oV_Success OUT VARCHAR2,
oT_TIMOrderIdList OUT TIM_CRS_VB.gU_TIMNumberTableType,
oT_OrderTypeCdList OUT TIM_CRS_VB.gU_TIMVarchar20TableType,
oT_OrderStateCdList OUT TIM_CRS_VB.gU_TIMVarchar20TableType,
oT_ThurnallStateCd OUT TIM_CRS_VB.gU_TIMVarchar20TableType,
oT_ActionErrorCd OUT TIM_CRS_VB.gU_TIMVarchar20TableType,
oT_ActionErrorText OUT TIM_CRS_VB.gU_TIMVarchar200TableType
);
The parameter definition
TYPE gU_TIMVarchar20TableType IS TABLE OF VARCHAR2(20)
INDEX BY BINARY_INTEGER;
VB.NET with Artinsoft wrappers.
Dim strStoredProc As String = "{call tim_crs_vb.ReceiveReadyOrders(?," & _
"{resultset 2000, oT_TIMOrderIdList, " & _
"oT_OrderTypeCdList, " & _
"oT_OrderStateCdList, " & _
"oT_ThurnallStateCd, " & _
"oT_ActionErrorCd, " & _
"oT_ActionErrorText})}"
With cmdStoredProc
.Connection = dbTIMConnection
.CommandText = strStoredProc
.CommandType = CommandType.Text
' Create parameters in exact order as in the procedure
Dim TempParameter As DbParameter
TempParameter = .CreateParameter()
TempParameter.ParameterName = "pSuccess"
TempParameter.DbType = DbType.String
TempParameter.Direction = ParameterDirection.Output
TempParameter.Size = 600
TempParameter.Value = ""
.Parameters.Add(TempParameter)
'.Parameters.Append .CreateParameter("pErrorCode", adVarChar, adParamOutput, 20, "")
'.Parameters.Append .CreateParameter("pErrorText", adVarChar, adParamOutput, 200, "")
End With
' Execute the procedure
Dim recTables As ADORecordSetHelper = New ADORecordSetHelper("")
recTables.LockType = LockTypeEnum.adLockReadOnly
recTables = ADORecordSetHelper.Open(cmdStoredProc, "")
Results
It returns values for result set recTables, but Null for the Out parameter pSuccess. I have ran the stored procedure to verify that it should return results. The calls work in the VB 6.0 version but not with .NET conversion via Artinsoft.