sqldinit() — Initialize an Allocated SQL Descriptor Area
Initializes an SQLDA_T structure and its associated SQLVAR_T structures (SQL descriptor area) for the specified number of columns.
This function returns no values:
psqlda
A pointer to a SQLDA_T structure previously allocated by
sqlald()
or your own memory allocation routine.ncols
The number of columns to initialize in
psqlda
.NOTES
CAUTION: Specifying an unallocated or noncontiguous SQL descriptor area, or setting
- The SQL descriptor area that
psqlda
specifies must already be allocated.- This function resets the specified SQL descriptor area to the number of columns specified by
ncols
and initializes the structure members to zero and NULL values. It does not add or subtract to the existing memory allocated for the descriptor area.- The SQLDA_T and SQLVAR_T structures to which
psqlda
refers must be contiguous with each other. In other words,psqlda
must point to one SQLDA_T structure followed byncols
SQLVAR_T structures. The number of bytes allocated atpsqlda
must be greater than or equal to the number of bytes thatsqldsize(ncols)
returns.- This function sets the DATA and INDICATOR members of SQLVAR_T structures to NULL.
ncols
greater than the number of columns currently allocated for the SQL descriptor area can result in unpredictable, platform-specific behavior. EXAMPLEThis example uses the
sqldsize()
function to obtain the number of bytes needed to store an SQL descriptor area fornres
columns. It then uses themalloc()
C run-time library routine to allocate the memory and passes the memory tosqldinit()
to initialize the structures:
SEE ALSO
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |