Retrieving Output Parameters by SQLGetData
For unbound output parameters following the highest-numbered bound parameter,
portable applications obtain the parameter data by calling SQLGetData in ascending order of parameter number. It is driver-defined whether an
application can obtain parameter data in a different sequence. It is driver-defined
whether parameter data for lower-numbered, unbound parameters is available.
The application can achieve type conversion of the parameter data by
specifying in the call to SQLGetData either the desired target type or the value SQL_APD_TYPE, which means that
the APD indicates the desired target type even though the parameter is unbound.
If the length of the unbound output parameter value exceeds the length of the
application's buffer, SQLGetData may be called multiple times to obtain the value of a single parameter of
SQL_CHAR or SQL_VARCHAR type in pieces of manageable size.