sqldynrq() — Execute a Dynamic Non-SELECT Statement

Compiles and executes any dynamic ESQL statement other than a cursor specification. This function supports the dynamic EXEC SQL EXECUTE IMMEDIATE... statement.

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

SYNTAX
int
sqldynrq ( sqln, prequest )
  SQLRQHDL    **sqln;    /* OUTPUT */
  char         *prequest;  /* INPUT */ 

sqln

The address of a pointer to a request handle value associated with and returned for the statement. For more information on request handles, see the "SQL Request Handles" section.

prequest

A pointer to the text of a non-SELECT statement.

NOTES

EXAMPLE

This example prompts the user to enter an UPDATE or DELETE statement for some table. The user can actually enter either a positioned or searched UPDATE or DELETE, depending on the availability of an open cursor. Statements are passed in the string request:

#include "proesql.h"
static SQLRQHDL *sql0 = (SQLRQHDL *) 0;
            .
            .
            .
printf("Enter ’update/delete <table> ... where ...’ request:\n");
gets(request);
/* EXEC SQL EXECUTE IMMEDIATE statement; */
{
    sqlcdbind(&SQLCODE, (char *)0);
    sqldynrq(&sql0,request);
} 

SEE ALSO

sqldynexec() — Execute a Dynamic SQL Statement, sqldynprep() — Prepare a Dynamic SQL Statement, sqlrequest() — Execute a Static ESQL Statement for static non-cursor statements.


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