Public Function GetNextValue(ByVal strForWhich As String) As Long
Dim oCon As New OleDbConnection()
Dim oCom As OleDbCommand
Dim cls As New DBClass()
Try
oCon = cls.OpenConnection()
oCom = New OleDbCommand("gls_GENERATORS", oCon)
oCom.CommandType = CommandType.StoredProcedure
oCom.Parameters.Add("@sequence", OleDbType.VarChar, 100).Value
= strForWhich
oCom.Parameters.Add("@sequence_id", OleDbType.Integer).Direction
= ParameterDirection.Output
oCom.ExecuteNonQuery()
GetNextValue =
Convert.ToInt64(oCom.Parameters("@sequence_id").Value)
Catch ex As Exception
Throw ex
Finally
oCom.Dispose()
oCom = Nothing
'Call the Close Connection Method .
cls.CloseConnection(oCon)
cls = Nothing
End Try
End Function
The Procedure Code is as follows.
CREATE PROCEDURE dbo.gls_GENERATORS
@sequence varchar(100),
@sequence_id INT OUTPUT
AS
BEGIN
BEGIN TRAN
UPDATE GENERATORS SET GENVALUE = GENVALUE + 1
WHERE GENDESC = UPPER(@sequence)
IF(@@ERROR = 0)
BEGIN
COMMIT TRAN
SELECT @sequence_id = GENVALUE FROM GENERATORS
WHERE UPPER(GENDESC)= UPPER(@sequence)
RETURN @sequence_id
END
ELSE
ROLLBACK TRAN
RETURN @@ERROR
END
when I execute this proc in third party tool like RapidSql I get the out
put.
But in JSQL I get the warning.
And even in the application I am developing, in the function I mention
above the proc is return DBNULL,
How can get the result. Please can u help me.
I am struck up with this.
Regards
Sridhar G
http://www.amautage.com
That error code you mention happens with jConnect and JISQL,
and ytou can turn the warnings off with the configuration menus.
ALl the warning means is that you called a stored procedure, that
returned an output parameter. It really should not be a problem.
pv
the isql command ignores this which is why you do not see it from the
dblib/ctlib version