After you allocate sufficient space for the second SQLDA (in this example, called fulsqlda), you must code the application to describe the SELECT statement.
Code your application to perform the following steps:
Using the DESCRIBE statement is preferred because the costs of preparing the statement a second time are avoided. The DESCRIBE statement reuses information previously obtained during the prepare operation to fill in the new SQLDA structure. The following statement can be issued:
EXEC SQL DESCRIBE STMT INTO :fulsqlda
After this statement is executed, each SQLVAR element contains a description of one column of the result table.