T
Tommy
I have a stored procedure that has an output parameter defined as output and
it is definately being set in the proc. I even went as far as hard coding a
value in the bottom of the proc to be sure it had something other than 0. If
I run it in Sybase central (sybase's version of Query Analyzer) it always
comes back with a value. Here is my vb.net code.
The sp declaration is included in the code below so you can see what is
defined in the db.
I have no idea where else to go with this. Any assistance is appreciated.
Dim oCon As New iAnywhere.Data.AsaClient.AsaConnection(gcConnString)
Dim oDs As New DataSet
Dim oCmd As New iAnywhere.Data.AsaClient.AsaCommand("HHPriceData_Select")
oCmd.CommandType = CommandType.StoredProcedure
oCmd.Connection = oCon
'ALTER PROCEDURE "DBA"."HHPriceData_Select"
'(
' @lihhstcdfk INT,
' @lihhitemfk INT,
' @lcplcd CHAR(1),
' @lccompancd CHAR(15),
' @licount INT OUTPUT
' Setup the parameters
oCmd.Parameters.Add("@lihhstcdfk",
iAnywhere.Data.AsaClient.AsaDbType.Integer)
oCmd.Parameters.Add("@lihhitemfk",
iAnywhere.Data.AsaClient.AsaDbType.Integer)
oCmd.Parameters.Add("@lcplcd", iAnywhere.Data.AsaClient.AsaDbType.Char)
oCmd.Parameters.Add("@lccompancd", iAnywhere.Data.AsaClient.AsaDbType.Char)
oCmd.Parameters.Add("@licount", iAnywhere.Data.AsaClient.AsaDbType.Integer,
ParameterDirection.Output)
' Fill in the parameters
oCmd.Parameters("@lihhstcdfk").Value = iStoreCdFk
oCmd.Parameters("@lihhitemfk").Value = iItemFk
oCmd.Parameters("@lcplcd").Value = cLastPlcd
oCmd.Parameters("@lccompancd").Value = cCompanCD
Dim oDa As New iAnywhere.Data.AsaClient.AsaDataAdapter(oCmd)
oDa.Fill(oDs, "PriceData")
' -- SHOULD HAVE A VALUE HERE
Dim iCnt As Integer = oCmd.Parameters("@licount").Value
it is definately being set in the proc. I even went as far as hard coding a
value in the bottom of the proc to be sure it had something other than 0. If
I run it in Sybase central (sybase's version of Query Analyzer) it always
comes back with a value. Here is my vb.net code.
The sp declaration is included in the code below so you can see what is
defined in the db.
I have no idea where else to go with this. Any assistance is appreciated.
Dim oCon As New iAnywhere.Data.AsaClient.AsaConnection(gcConnString)
Dim oDs As New DataSet
Dim oCmd As New iAnywhere.Data.AsaClient.AsaCommand("HHPriceData_Select")
oCmd.CommandType = CommandType.StoredProcedure
oCmd.Connection = oCon
'ALTER PROCEDURE "DBA"."HHPriceData_Select"
'(
' @lihhstcdfk INT,
' @lihhitemfk INT,
' @lcplcd CHAR(1),
' @lccompancd CHAR(15),
' @licount INT OUTPUT
' Setup the parameters
oCmd.Parameters.Add("@lihhstcdfk",
iAnywhere.Data.AsaClient.AsaDbType.Integer)
oCmd.Parameters.Add("@lihhitemfk",
iAnywhere.Data.AsaClient.AsaDbType.Integer)
oCmd.Parameters.Add("@lcplcd", iAnywhere.Data.AsaClient.AsaDbType.Char)
oCmd.Parameters.Add("@lccompancd", iAnywhere.Data.AsaClient.AsaDbType.Char)
oCmd.Parameters.Add("@licount", iAnywhere.Data.AsaClient.AsaDbType.Integer,
ParameterDirection.Output)
' Fill in the parameters
oCmd.Parameters("@lihhstcdfk").Value = iStoreCdFk
oCmd.Parameters("@lihhitemfk").Value = iItemFk
oCmd.Parameters("@lcplcd").Value = cLastPlcd
oCmd.Parameters("@lccompancd").Value = cCompanCD
Dim oDa As New iAnywhere.Data.AsaClient.AsaDataAdapter(oCmd)
oDa.Fill(oDs, "PriceData")
' -- SHOULD HAVE A VALUE HERE
Dim iCnt As Integer = oCmd.Parameters("@licount").Value