Level 2 subroutine
Return input and output parameters, and columns for the specified procedures.
call EDSProcedureColumns(HSTMT_IV, PROCTABLE_STRUCT, COLUMNNAME_SV, MAXROWS_IV, NUMROWS_IV, ARRAY_STRUCT)
•HSTMT_IV An input integer value that indicates the statement handle.
•PROCTABLE_STRUCT An input EDSTABLE_STRUCT structure for input of procedure table QUALIFIER, OWNER, and NAME.
•COLUMNNAME_SV An input string containing the search pattern for column names.
•MAXROWS_IV An input integer value indicating the maximum number of rows in the result array.
•NUMROWS_IV An output integer value indicating the actual number of rows in the result array.
•ARRAY_STRUCT An output array of EDSPROCCOL_STRUCT structures containing column and input and output parameters that make up the result set for the specified procedures.
Description
EDSProcedureColumns is typically used before statement execution to retrieve information about procedure parameters and columns from the data source's catalog.
The PROCTABLE.OWNER, PROCTABLE.NAME, and COLUMNNAME_SV arguments accept search patterns. For more information about valid search patterns, see Catalog Commands.
EDSProcedureColumns returns an array of EDSPROCCOL_STRUCT structures, ordered by PROCEDURE_QUALIFIER, PROCEDURE_OWNER, PROCEDURE_NAME, and COLUMN_TYPE. The following table lists the columns in the result set.
Column Name |
Data Type |
Comments |
PROCEDURE_QUALIFIER |
string |
Procedure qualifier identifier; NULL if not applicable to the data source. |
PROCEDURE_OWNER |
string |
Procedure owner identifier; NULL if not applicable to the data source. |
PROCEDURE_NAME |
string |
Procedure identifier. not NULL |
COLUMN_NAME |
string |
Procedure column identifier. not NULL |
COLUMN_TYPE |
integer |
not NULL Defines the procedure column as parameter or a result set column: EDS_PARAM_TYPE_UNKNOWN: the procedure column is a parameter whose type is unknown. EDS_PARAM_INPUT: the procedure column is an input parameter. EDS_PARAM_INPUT_OUTPUT: the procedure column is an input/output parameter. EDS_RESULT_COL: the procedure column is a result set column. |
DATA_TYPE |
integer not NULL |
ODBC SQL data type. For a list of valid ODBC SQL data types, see SQL Data Types. |
TYPE_NAME |
string not NULL |
Data source–dependent data type name; for example, “CHAR”, “VARCHAR”, “MONEY”, “LONG VARBINARY”, or “CHAR ( ) FOR BIT DATA”. |
PRECISION |
integer |
The precision of the procedure column on the data source. NULL is returned for data types where precision is not applicable. For more information concerning precision, Precision. |
LENGTH |
integer |
The transfer size of the data; that is, the length in bytes of data transferred on an EDSGetData or EDSFetch operation if EDS_SQL_DEFAULT is specified. For numeric data, this size may be different from the size of the data stored on the data source. For more information, see Length. |
SCALE |
integer |
The scale of the procedure column on the data source. NULL is returned for data types where scale is not applicable. For more information concerning scale, see Default Data Type Conversions. |
RADIX |
integer |
Either 10 or 2. If it is 10, the values in PRECISION and SCALE give the number of decimal digits allowed for the column. For example, a DECIMAL(12,5) column would return a RADIX of 10, a PRECISION of 12, and a SCALE of 5. If it is 2, the values in PRECISION and SCALE give the number of bits allowed in the column. For example, a FLOAT column could return a RADIX of 2, a PRECISION of 53, and a SCALE of NULL. Note, for numeric data types, the data source and driver can return a RADIX of either 2 or 10. For example, a FLOAT column could return a RADIX of 10, a PRECISION of 15 and a SCALE of NULL. NULL is returned for data types where radix is not applicable. |
NULLABLE |
integer not NULL |
Whether the procedure column accepts a NULL value: EDS_NO_NULLS: the procedure column does not accept NULL values. EDS_NULLABLE: the procedure column accepts NULL values. EDS_NULLABLE_UNKNOWN: it is not known if the procedure column accepts NULL values. |
REMARKS |
string |
A description of the procedure column. |
Return Value
EDSProcedureColumns returns EDS_SUCCESS, EDS_ERROR, or EDS_INVALID_HANDLE.
When EDSProcedureColumns returns EDS_ERROR, you can obtain an associated SQLSTATE value with more specific information by calling EDSError. The following table lists each typical SQLSTATE value and explains each one in the context of the command EDSProcedureColumns.
The following table lists possible SQLSTATE values:
SQL STATE |
Error |
Description |
08S01 |
Communication link failure |
The communication link between the driver and the data source to which the driver was connected failed before the function completed processing. |
24000 |
Invalid cursor state |
Results were pending on the statement handle from a previous SELECT statement or a cursor associated with the statement handle had not been closed. |
IM001 |
Driver does not support this function |
The driver associated with the statement handle does not support the function. |
S1000 |
General error |
An error occurred for which there was no specific SQLSTATE and for which no implementation-specific SQLSTATE was defined. The error message returned by EDSError in the argument ERRORTEXT describes the error and its cause. |
S1001 |
Memory allocation failure |
The driver was unable to allocate the memory required to support execution or completion of the function. |
S1008 |
Operation cancelled |
Asynchronous processing was enabled for the statement handle. The function was called and before it completed execution, EDSCancel was called on the statement handle. Then the function was called again on the statement handle. |
S1010 |
Function sequence error |
An asynchronously executing function (not this one) was called for the statement handle and was still executing when this function was called. |
S1C00 |
Driver not capable |
A procedure qualifier or a procedure owner was specified and the driver or data source does not support one or both of the qualifiers. A string search pattern was specified for the procedure owner, procedure name, or column name, and the driver or data source does not support search patterns for one or more of those arguments. |
S1T00 |
Timeout expired |
The timeout period expired before the data source returned the result set. The timeout period is set through EDSSetStmtOption, EDS_QUERY_TIMEOUT. |
See Also
EDSBindCol assigns an ESL variable for a column in a result set.
EDSCancel cancels statement processing.
EDSExtendedFetch fetches a block of data or scrolls through a result set.
EDSProcedures returns a list of procedures in a data source.