sqlald() — Allocate Dynamic SQL Descriptor

Allocates memory for the SQL descriptor area, including the SQLDA_T structure and one SQLVAR_T structure for each column. Supports the EXEC SQL ALLOCATE DESCRIPTOR... statement.

On successful completion, sqlald() returns a pointer to the allocated SQLDA_T structure; otherwise it returns a 0 pointer value. Since a failed sqllogin returns to the original state as if no sqllogin() had been executed, sqlald() fails after a failed sqllogin(). An sqlald() call succeeds only when the application successfully logs in.

SYNTAX
struct SQLDA_T *
sqlald ( Progress )
  int  ncols;    /* INPUT */ 

ncols

The maximum number of columns available for a dynamic cursor statement. The maximum value for ncols is 512.

EXAMPLE

This example allocates an SQL descriptor area for 10 columns, and assigns it to psqlda:

#include "proesql.h"
struct SQLDA_T *psqlda=(struct SQLDA_T *) 0;
            .
            .
            .
/* sqlald allocates storage for the SQLDA structure, including
   an instance of the SQLVAR structure for each column,
   up to the maximum requested. */

if ((psqlda = sqlald((int) 10)) == (struct SQLDA_T *) 0)
{
    printf ("Couldn’t alloc memory for SQLDA with 10 columns.\n");
    exit(2);
} 

SEE ALSO

sqldld() — Deallocate Dynamic Descriptor Area, proesql.h


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