I am trying to execute a stored procedure from my Operation, the way I have the most satisfatory result was by the following call:
Set tResult = ##Class(EnsLib.SQL.GatewayResultSet).%New()
Set tQuery = "EXEC MY_PROC @name = 'Jhon', @profession = 'carpenter'"
Set tSC = ..Adapter.ExecuteQuery(.tResult, tQuery)
The procedure is executed, (it removes a registry from an ODSE database and has no return by default) but I get an error like
"Error #5023 Remote Gateway Error. The statement did not return a resultset."
And my operation stops.
I even tried the method ExecuteProcedure without success.
Can anyone help me on that :)
Ps. I'm new on this stack, and a junior at all. D:
Thanks in advance.
I've found my problem, I was calling the wrong method for this occasion. The right method to call a procedure or a query with no return is
ExecuteUpdate()
instead ofExecuteQuery()
. This method returns only the number of rows affected and receive our procedure command. So the example would be like:The official documentation of Objectscript can be like a dark cave sometimes.