The parameters dictionary shows exactly what I did set the parameters to.
So, the output parameter is not changed there from procedure which always select the “nr”.
The point is, that in the MBS example, no argument for the output parameter is specified, which is complaint by SQL server as needed.
So, when I try to send only 2 arguments, omiting the output parameter, I get the error.
Jarr = JRequest.LookupArrayOfVariantOf("params") // from the webview2
Params = MSSQL.getParams(JArr)
Cmd = new SQLCommandMBS()
Cmd.Connection = Con
Cmd.CommandText = SQL
Cmd.setParams(Params) // set parameters by variant / getType
Cmd.Execute()
JParams = JResult.SetObjectOf("params") // prepare answer
Cmd.setParamsOf(JParams) // do the reverse and put Cmd.Parameters in JSON
if Cmd.isResultSet then // no resulset needed here
Jarr = JResult.SetArrayOf("data")
Cmd.setArrayOf(Jarr)
end if
Cmd.Close()
Con.Commit()
Well, first I may ask if this is current 23.0 plugin or something older?
And I assume this is SQL Server via ODBC?
Technically we ask SQL Server via SQLProcedureColumns for the parameters needed. And ParamCount should show how many we found. The parameters dictionary is build to let you see it in the debugger, but it can only report parameters with names.
maybe you can send me later a test project, so I can debug this a bit?
No, it’s not ODBC; I connect via SQLConnectionMBS.kSQLServerClient.
It’s MBS 22 version → how can I get the version from plugin?
As said in MBS documentation, some servers/databases don’t give correct information about parameters.
See above: the MBS example does not use default value for parameter, but calling stored procedure without argument seems to work there; which does not work for my example.
A test with more than one argument could raise the problem, maybe?