Programming Guide |
Generates a data structure used in SELECT statement generation
#include <tmusubs.h>int dm_gen_sql_info(int type, char *cursor_name);
type
- Type of
SELECT
to 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_info
generates a data structure associated withSELECT
statements. The type isSELECT
when the function is called as the result of the transaction commandsSELECT
andVIEW
. Thetype
isVALIDATE
when the function is called as a result of processing a validation link. The type isCHECK_PKEY
when 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;
}