Doug,
I will describe the way we would do that.
First we utilize the Data Manager (ODBC Drivers) add-on for Cloverleaf.
Then we would invoke a Stored Procedure as you are doing. Our intent would be to have one reusable Tcl Procedure to do be used wih all invocations of query/rply Stored Procedurs. So the specifics of each invocation would be externalized from the Tcl proc. In our case that would be in a lookup table.
We would eploy parameters for the exchange. That is there would be parameter INPUT to the Stored Procedure and Parameters (probably only two) OUTPUT from the Store Procedure.
One of the OUPUT parameters would be a subfielded parameter containing a return code to indoicate success/failure of the Stored Procedure – a non-zero return code would be the actual error code detected by The Stored Procedure – the second subfield would be the literal associated with the code returned in the first sunfield. This allows us to detect an error has occurred; take whaever actin is warranted; and externalize the fact that a error occurred via email, pages, Global Monitor, etc.
The other OUPUT Parameter would be the response to the query. Our thoughts are that this could be virtually any structure of data (XML. HL7, VRL, FRL, HRL) but it would be the responsibility of the Stored Proicedur to construct the format. We then would use Cloverleaf parsing capabilities to manage that returned message.
One note about Sql Server when invoking a Stored Procedure and using parameters. The OUTPUT Parameters are stuck behind a recordset even if the Stored Procedure did not create a recordset. So your Tcl code will need to exhaust the recordset (won’t take but one action with our model because our model does not have the Stored Procedure return a recordset). Then the OUTPUT Parameters are populated. This is not true with Oracle DBs.
Our model attempts to fit the Services Architecture model that is why would exchange mesage structures as parameters rather than recordsets which have no known standard.
Anyway that is our way of looking at it…
email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.