SQLProcedures lists all procedures in the requested range. A user may or may not have permission to execute any of these procedures. To check accessibility, an application can call SQLGetInfo and check the SQL_ACCESSIBLE_PROCEDURES information value. Otherwise, the application must be able to handle a situation where the user selects a procedure that it cannot execute. For information about how this information might be used, see Procedures.
Note |
|---|
| For more information about the general use, arguments, and returned data of ODBC catalog functions, see Catalog Functions. |
SQLProcedures returns the results as a standard result set, ordered by PROCEDURE_CAT, PROCEDURE_SCHEMA, and PROCEDURE_NAME.
Note |
|---|
| SQLProcedures might not return all procedures. Applications can use any valid procedure, regardless of whether it is returned by SQLProcedures. |
The following columns have been renamed for ODBC 3.x. The column name changes do not affect backward compatibility because applications bind by column number.
|
ODBC 2.0 column
|
ODBC 3.x column
|
| PROCEDURE_QUALIFIER | PROCEDURE_CAT |
| PROCEDURE _OWNER | PROCEDURE _SCHEM |
To determine the actual lengths of the PROCEDURE_CAT, PROCEDURE_SCHEM, and PROCEDURE_NAME columns, an application can call SQLGetInfo with the SQL_MAX_CATALOG_NAME_LEN, SQL_MAX_SCHEMA_NAME_LEN, and SQL_MAX_PROCEDURE_NAME_LEN options.
The following table lists the columns in the result set. Additional columns beyond column 8 (PROCEDURE_TYPE) can be defined by the driver. An application should gain access to driver-specific columns by counting down from the end of the result set rather than specifying an explicit ordinal position. For more information, see Data Returned by Catalog Functions.
|
Column name
|
Column number
|
Data type
|
Comments
|
| PROCEDURE_CAT (ODBC 2.0) | 1 | Varchar | Procedure catalog identifier; NULL if not applicable to the data source. If a driver supports catalogs for some procedures but not for others, such as when the driver retrieves data from different DBMSs, it returns an empty string ("") for those procedures that do not have catalogs. |
| PROCEDURE_SCHEM (ODBC 2.0) | 2 | Varchar | Procedure schema identifier; NULL if not applicable to the data source. If a driver supports schemas for some procedures but not for others, such as when the driver retrieves data from different DBMSs, it returns an empty string ("") for those procedures that do not have schemas. |
| PROCEDURE_NAME (ODBC 2.0) | 3 | Varchar not NULL | Procedure identifier. |
| NUM_INPUT_PARAMS (ODBC 2.0) | 4 | N/A | Reserved for future use. Applications should not rely on the data returned in these result columns. |
| NUM_OUTPUT_PARAMS (ODBC 2.0) | 5 | N/A | Reserved for future use. Applications should not rely on the data returned in these result columns. |
| NUM_RESULT_SETS (ODBC 2.0) | 6 | N/A | Reserved for future use. Applications should not rely on the data returned in these result columns. |
| REMARKS (ODBC 2.0) | 7 | Varchar | A description of the procedure. |
| PROCEDURE_TYPE (ODBC 2.0) | 8 | Smallint | Defines the procedure type: SQL_PT_UNKNOWN: It cannot be determined whether the procedure returns a value. SQL_PT_PROCEDURE: The returned object is a procedure; that is, it does not have a return value. SQL_PT_FUNCTION: The returned object is a function; that is, it has a return value. |
The SchemaName and ProcName arguments accept search patterns. For more information about valid search patterns, see Pattern Value Arguments.