|  | Programming Guide |        | 
Generates and executes SQL statements
#include <tmusubs.h>int dm_exec_sql(int type, char *cursor_name);
type- Type of SQL statement specified by one of the constants listed in Table 5-1.
cursor_name- Name of the cursor associated with the SQL statement.
dm_exec_sqlis called from a transaction model or a user event function to generate and execute SQL statements according to one of the following constants supplied for thetypeparameter:
dm_exec_sql(BUILD_SELECT) anddm_exec_sql(BUILD_VALIDATE) should not be called without a prior call to dm_gen_sql_info to initialize the statement structures. In the standard transaction models,dm_exec_sqland other related functions are called by the following requests:
dm_exec_sql(DECLARE_xxx)should not be called without a prior call to sm_bi_initialize. The transaction manager callssm_bi_initializeautomatically when sm_tm_command("NEW")orsm_tm_command("SELECT")is executed. In the standard transaction models,dm_exec_sqland other related functions are called by the following requests:



