#define SQL_TEXT Latin_Text
#include <sqltypes_td.h>
#include <string.h>
/* return a pointer to the SQLSTATE string */
void *Find_Text(VARCHAR_LATIN *searched_string,
VARCHAR_LATIN *pattern,
CHARACTER_LATIN *result,
char sqlstate[6])
{
int pattern_found = 0;
if (strlen((char *)pattern) == 0)
{
/* send a warning because probably a mistake */
*result = 'T';
strcpy(sqlstate, "01H01"); /* see SQLSTATE table */
return;
}
/* do the pattern match -- code not shown */
...
if (pattern_found)
*result = 'T';
else
*result = 'F';
/* SQLSTATE is initialized to zero so normal return does */
/* not need to set it */
return;
}