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:

SYNTAX
void
sqldinit ( psqlda, ncols )
  struct SQLDA_T  *psqlda;    /* INPUT-OUTPUT */
  int               ncols;    /* INPUT */ 

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 ncols greater than the number of columns currently allocated for the SQL descriptor area can result in unpredictable, platform-specific behavior.
EXAMPLE

This example uses the sqldsize() function to obtain the number of bytes needed to store an SQL descriptor area for nres columns. It then uses the malloc() C run-time library routine to allocate the memory and passes the memory to sqldinit() to initialize the structures:

#include "proesql.h"
struct SQLDA_T *psqlda;
int        nres, nbytes;
            .
            .
            .
nres = 10;
nbytes = sqldsize(nres);

psqlda = (struct SQLDA_T *) malloc(nbytes);
if (psqlda == (struct SQLDA_T *) NULL)
{
    printf( "allocation error\n" );
    return;
}
sqldinit( psqlda, nres );
            .
            .
            . 

SEE ALSO

sqlald() — Allocate Dynamic SQL Descriptor


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095