Restrictions on stored procedures returning result sets
In general, calling a stored procedure that returns a result set is equivalent to executing a query statement.
Calling a stored procedure that returns a result set is bounded by
the following restrictions:
SQLDescribeCol()
orSQLColAttribute()
do not return column names for static query statements. In this case of static statements, these functions return the ordinal position of columns instead.- All result sets are read-only.
- You cannot use schema functions (such as the
SQLTables()
function) to return a result set. If you use schema functions within a stored procedure, you must close all cursors that are associated with the statement handles of those functions. If you do not close these cursors, your stored procedure might return extraneous result sets. - When you prepare a stored procedure, you cannot access the column information for the result set until after you issue the CALL statement. Normally, you can access result set column information immediately after you prepare a query.