![]() | ![]() | Programming Guide |
Generates a data structure used in SQL SELECT statements
#include <tmusubs.h>int dm_gen_sql_info(int type, char *cursor_name);
type- Type of SQL
SELECTto generate, specified by one of these constants:SELECT
VALIDATE
CHECK_PKEYcursor_name- Name of the cursor associated with the SQL statement.
- 0 Success.
dm_gen_sql_infogenerates a data structure associated with SQLSELECTstatements. The type isSELECTwhen the function is called as the result of the transaction commandsSELECTandVIEW. ThetypeisVALIDATEwhen the function is called as a result of processing a validation link. The type isCHECK_PKEYwhen the function is called as a result of checking for duplicate key values before inserting a new row or updating the primary key columns.
int gen_select (cursor)
char *cursor;
{
int retcode;
retcode = dm_gen_sql_info (SELECT, cursor1);
...
return retcode;
}