Example Using FNC_GLOP_Map_Page - Teradata Vantage - Analytics Database

SQL External Routine Programming

Deployment
VantageCloud
VantageCore
Edition
VMware
Enterprise
IntelliFlex
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
ft:locale
en-US
ft:lastEdition
2025-03-30
dita:mapPath
iiv1628111441820.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
qnu1472247494689
lifecycle
latest
Product Category
Teradata Vantageā„¢

Consider an external routine that maps one of five XML syntax rules pages depending on type of document. The XML rules are in a read-only system map in the XML_Document_Syntax set. The reason for using a system map is that the GLOP is read-only, so only one copy needs to exist and the XML document syntax rules are system-wide and all documents need to use the same syntax.

More than one system-type GLOP can be defined in a set. Specific generic system GLOP data can be mapped also.

#define XML_INDEX  0
XML_Rules   Current_XML_Rules;
GLOP_Map_t *MyGLOP;
int         Page_map;
int         glop_status

. . .

glop_status = FNC_Get_GLOP_Map(&MyGLOP);
if (!glop_status)
   ... process error: Not a member of any GLOP table
if ( MyGLOP->GLOP[XML_INDEX].GLOP_Ptr == NULL)
{
   ... process error: XML Syntax map does not exist
};

/* Determine page to map, based on "document_type" input parameter */
switch (*document_type)
{
   case WEB_page:
      Page_map = 1;
      break;
   case PDF_page:
      Page_map = 2;
      break;
   case Text_page:
      Page_map = 3;
      break;
   case Graphic_page:
      Page_map = 4;
      break;
   case Formula_page:
      Page_map = 5;
      break;
   Default:
      /* error: invalid documents option - generate an error */
}

if (MyGLOP->GLOP[XML_INDEX].page != Page_map)
{   if (!FNC_GLOP_Map_Page(XML_INDEX, Page_map)) 
      ... error: could not map page
}

Current_XML_Rules = MyGLOP->GLOP[XML_INDEX].GLOP_ptr;

/* process the document */