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:

SYNTAX
int
sqldyndesc ( sqln, psqlda )
  SQLRQHDL  *sqln;  /* INPUT */
  SQLDA_T    *psqlda;    /* OUTPUT */ 

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

This example describes and initializes the column information in the SQL descriptor area to which psqlda refers for a cursor specification:

#include "proesql.h"
static SQLRQHDL *sql1 = (SQLRQHDL *) 0;
static long SQLCODE;
struct SQLDA_T *psqlda = (struct SQLDA_T *) 0;
..........
..........
..........
if ((psqlda = sqlald((int) 10)) == (struct SQLDA_T *) 0)
{
  printf("Couldn’t alloc memory for SQLDA with 10 columns.\n");
  break;
}
...........
...........
...........
sqlcdbind(&SQLCODE, (char *)0);
sqldynprep(&sql1, "SELECT * FROM customer", "DEMOSTMT");
...........
...........
...........
/* EXEC SQL DESCRIBE DEMOSTMT USING SQL DESCRIPTOR psqlda; *
sqlcdbind(&SQLCODE, (char *)0);
sqldyndesc(sql1, psqlda); 

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