Installation guide

5. mxODBC Overview
This generates a result set with column COLUMN_TYPE which has the needed
information.
Please see the documentation in section 7.6.1 Catalog Methods for
cursor.procedurecolumns() for details.
5.6.4 Special constraints of some ODBC drivers
Mixing output parameters and output result sets
Some ODBC drivers, most notably, the MS SQL Server Native Client, send the
output parameter data only after any output result sets which the stored
procedure may have created.
Since the mxODBC cursor methods return the output parameter right after
executing the stored procedure and before fetching any result sets, the output
parameters are not yet updated. Furthermore, there is no method of accessing the
output parameters after those methods have returned.
As a result, you won't see output parameter updates in your application, if you
are using both output parameters and output result sets in your stored
procedures.
The work-around for this is to pass back the output parameter data using an
additional result set and then fetching this using the
cursor.nextset() method
after the other result sets. Also see section 5.6.5 Using Result Sets for passing
back Output Data on this topic.
Example:
cursor.callproc('procname', parameters)
# Get the original output result set
output_result_set = cursor.fetchall()
# Switch to the new output parameter result set
cursor.nextset()
output_parameter_result_set = cursor.fetchall()
Using None as value for output parameters
mxODBC uses the value passed to the cursor execution method as hint for the
output type of the output parameter, in case the ODBC driver does not provide
this information.
If you pass in
None as placeholder for the output parameter value, mxODBC is, in
some cases, unable to determine the correct output type. It then defaults to using
a
VARCHAR(4000) output parameter value and sends back the data as character
string.
73