Hi I've developped an SP in Sybase and tested it on the console, therefore I know it works. However when calling it from my script I just can't seem to send the parameter values.
This is my code:
And this is the exception I get:
This is my code:
VB.NET:
Public Function queryModify(ByVal storedProcedure As String, ByVal parameters(,) As String) As Integer
MyOdbcCommand = New OdbcCommand(storedProcedure, MyOdbcConnexion)
MyOdbcCommand.CommandType = CommandType.StoredProcedure
Dim height, i As Integer
height = parameters.GetLength(1)
For i = 0 To height
MyOdbcCommand.Parameters.AddWithValue(parameters(i, 0), parameters(i, 1))
Next
Return MyOdbcCommand.ExecuteNonQuery
End Function
Dim query(2, 1) As String
query(0, 0) = "@Valeur"
query(1, 0) = "@Class"
query(0, 1) = "Value1"
query(1, 1) = "Value2"
queryModify("MyStoredProcedure", query)
And this is the exception I get:
VB.NET:
System.Data.Odbc.OdbcException: ERROR [HY000] [DataDirect][ODBC Sybase Wire Protocol driver][SQL Server]Procedure SW_P_CreateIssuesOTC expects parameter @Valeur, which was not supplied.
ERROR [HY000] [DataDirect][ODBC Sybase Wire Protocol driver][SQL Server]Procedure SW_P_CreateIssuesOTC expects parameter @Class, which was not supplied.
à System.Data.Odbc.OdbcConnection.HandleError(OdbcHandle hrHandle, RetCode retcode)
à System.Data.Odbc.OdbcCommand.ExecuteReaderObject(CommandBehavior behavior, String method, Boolean needReader, Object[] methodArguments, SQL_API odbcApiMethod)
à System.Data.Odbc.OdbcCommand.ExecuteReaderObject(CommandBehavior behavior, String method, Boolean needReader)
à System.Data.Odbc.OdbcCommand.ExecuteNonQuery()
à SQLCommand.SQLOdbcCommand.queryModify(String storedProcedure, String[,] parameters) in ...