C関数定義 - Teradata Database - Teradata Vantage NewSQL Engine

Teradata Vantage™ SQL外部ルーチン プログラミング

Product
Teradata Database
Teradata Vantage NewSQL Engine
Release Number
16.20
Published
2019年3月
Language
日本語
Last Update
2019-10-29
dita:mapPath
ja-JP/uhh1512082756414.ditamap
dita:ditavalPath
ja-JP/uhh1512082756414.ditaval
dita:id
B035-1147
Product Category
Software
Teradata Vantage
#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;
}