sqldynexec() — Execute a Dynamic SQL Statement

Executes a prepared dynamic ESQL statement. This function supports both the dynamic EXEC SQL OPEN... and EXEC SQL EXECUTE... statements.

This function returns normalized values. For more information, see the function return values in the "General Diagnostics" section in this chapter:

SYNTAX
int
sqldynexec ( 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 that contains the data values for any dynamic parameter markers in the statement.

NOTES

EXAMPLE

This example prepares and executes a cursor specification without any parameter markers:

#include "proesql.h"
static SQLRQHDL *sql0 = (SQLRQHDL *) 0;
static long    SQLCODE;
            .
            .
            .
sqlcdbind(&SQLCODE, (char *)0);
sqldynprep(&sql0, "SELECT * FROM customer", "STMT5");
if (SQLCODE < 0)
  return;
            .
            .
            .
sqlcdbind(&SQLCODE, (char *)0);
sqldynexec(sql0, (struct SQLDA_T *)0);
if (SQLCODE < 0)
{
  printf("Error executing request\n");
  sqldynclose(sql0, SQL_STMTDROP);
  return;
} 

SEE ALSO

sqldynclose() — Close an SQL Statement, sqldynprep() — Prepare a Dynamic SQL Statement, and sqlrequest() — Execute a Static ESQL Statement for executing static ESQL statements.


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