Metadata describes the statement interface. The statement metadata contains the type of statement, the number of
columns defined by the statement and the metadata for each column. Statement columns are of three primary types:
result columns, parameters, and the return value. There is also a distinction between the metadata available for a
prepared statement and for a statement that has been executed since not all statement results are known at prepare
time. For all statement types except CALL, the statement metadata is all available at prepare time. CALL statement metadata
that is available at prepare time includes the metadata from the statement itself and that metadata is not to be confused
with the metadata defined by the SQL routine that is called. Each routine defines a formal interface that consists of an
optional return value and option input, input-output and output parameters. An SQL routine might also return a single
preplanned result set. That metadata is available at prepare time and it consists of some number of columns of type
SQLRESULTCOL. An SQL routine might also declare that it returns some dynamic result sets, the metadata for which is not
available until after the statement is executed and the result sets bound dynamic cursors.
formalParameters is a collection of '?' parameters found in the prepared statement.
It may differ from the parameters collection if literal replacement occurred. This
property is mainly for internal use and metadata reporting. It is not meant to be used
for the statement descriptor.
interface is an integer value indicating the routine interface:
-2 - Return value, dynamic cursors returned (zero, one or more)
-1 - No return value, dynamic cursors returned (RETURNRESULTSETS, zero one or more)
0 - No return value, no dynamic cursors (NOT RETURNRESULTSETS, aka "function" procedure although a function should return a value (interface = 2))
1 - No return value, one pre-planned result set (AKA "query" procedure)
2 - Return value, no dynamic cursors (NOT RETURNRESULTSETS)
The parameters collection contains the metadata for each actual parameter
contained in the source statement. ..parameters.Count() is equivalent to the
number of '?' parameters found in the source statement and the list position
corresponds to the ordinal position of the '?' in the source statement.