When invoking an Sql Server Stored Procedure, you can have 4 kinds of datum.
There can be parameters exchanged between Cloverleaf(R) (your Tcl proc) and the invoked Stored Procedure.
There can be 3 types of parameters, INPUT (to the Stored Procedure from Cloverleaf) OUTPUT (from the Stored Procedure to Cloverleaf) and INPUT/OUTPUT type parameters. The last is where you send a parameter to the Stored Procedur and it returns something (perhaps different) in the same parameter. For Sql Server I do not recall how that is defined in the Stored Procedure or in your SQL BindParameter inside your Tcl proc so I won’t discuss the last parametr tyep.
Parameters are bound using a bind action and at that time are ,among other things, defined as INPU or OUTPUT.
These are complement sets.
That is an OUTPUT parameter in Cloverleaf (the invoker) is an Input paramter in the Stored Procedure and vice-versa.
In Sql Server Stored Procedure you do not have to explicitly specify an INPUT parameter as INPUT – BUT – you do have to specifically declare an output parameter as OUTPUT.
Of course if the Stored Procedure is coded that way the fourth datum you could receive is a populated recordset.
In SQL Server ODBC, you ALWAYS get back a recordset – even if the Stored Procedure does not populate one. So assuming you are invoking a Stored Procedure to update a Table, you would not expect the Stored Procedure to populate a recordset. However there will be a recordset (empty) anyway.
So in order to get to the OUTPUT parameters (assuming they are defined correctly in the Stored Procedure) you first have to exhaust the recordset (even if it is empty).
The OUTPUT parameters are ‘hiding’ behind the recordset and you need to get through the recordset to get the OUTPUT paramerts from the Stored Procedure.