sqldyndesc() — Get Dynamic Column Descriptions
Gets column description information for a dynamic ESQL statement. This function supports the dynamic EXEC SQL DESCRIBE... statement.
This function returns normalized values. For more information, see the function return values in the "General Diagnostics" section in this chapter:
sqln
A pointer to the request handle that a previous call to
sqldynprep()
returns. For more information on request handles, see the "SQL Request Handles" section.psqlda
A pointer to an SQLDA_T structure to receive the column description information for the columns in the result set that the statement associated with
sqln
specifies.NOTES
EXAMPLE
- Typically, an application calls
sqldynprep()
to prepare a dynamic SQL statement, allocates the SQLDA_T structure, and callssqldyndesc()
to fill in the column descriptions. Before callingsqldyndesc()
, the application can also callsqldynncols()
to return the number of columns required for the result set and thus ensure that the SQLDA_T structure is large enough to hold the returned information.- To receive attribute information, the supplied SQLDA_T structure must be allocated large enough to hold the number of columns in the result set (
psqlda
->SQLN is equal to or greater than the number of columns in the result set). If it is not large enough,sqldyndesc()
setspsqlda
->COLCNT to the actual number of columns required and returns 0 with no attribute information in the structure.This example describes and initializes the column information in the SQL descriptor area to which
psqlda
refers for a cursor specification:
SEE ALSO
sqlald() — Allocate Dynamic SQL Descriptor, sqldynncols() — Get the Number of Columns in a Result Set, sqldynprep() — Prepare a Dynamic SQL Statement,
proesql.h
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |