16.20 - C Function Using GLOP Data - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL External Routine Programming

Product
Advanced SQL Engine
Teradata Database
Release Number
16.20
Release Date
April 2020
Content Type
Programming Reference
Publication ID
B035-1147-162K
Language
English (United States)

This example shows how to create a GLOP set, add GLOP data to the GLOP set, create a UDF as a member of the GLOP set, and use the GLOP data from the UDF. Take the following steps to use this example:

  1. If the DBCExtension database does not exist, use the DIPGLOP script to create it.

    For information on the DIP utility and the DIPGLOP script, see Teradata Vantage™ - Database Utilities , B035-1102 .

  2. Use the CREATE GLOP SET statement to create a GLOP set called MyGlopTestSet.

    See SQL Statement to Create GLOP Set.

  3. Create a UDF called compinform that returns a BLOB that will be used as the GLOP data.

    See SQL Definition for the Function That Generates GLOP Data and C Function Definition That Generates GLOP Data.

  4. Call DBCExtension.GLOP_Add to add the GLOP data to the GLOP set.

    See Add Data to GLOP Set.

  5. Create a UDF called glop_map1 that is a member of the GLOP set and maps the GLOP set to use the data.

    See SQL Definition for the Function That Uses GLOP Data and C Function Definition That Uses GLOP Data.

  6. Call the glop_map1 UDF.

    See Example Query That Calls the UDF That Uses the GLOP Data.