16.20 - Syntax - 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)
int FNC_Get_GLOP_Map(GLOP_Map_t **Map)
GLOP_Map_t ** Map
The address of where FNC_Get_GLOP_Map is to store a pointer to a GLOP_Map_t structure.
If the external routine has no access to a GLOP set, FNC_Get_GLOP_Map returns a NULL pointer. This is the case when the external routine contains no USING GLOP SET clause in the CREATE statement or the GLOP data table could not find a row for the specified GLOP set of which the external routine is a member.
Structure GLOP_Map_t is an array of eight GLOP_ref_t structures, plus some internal structures. Eight GLOP data references is the maximum an external routine is allowed to map.
GLOP_Map_t has the following definition:
typedef struct
{
  GLOP_ref_t  GLOP[8],
} GLOP_Map_t;
where structure GLOP_ref_t has the following definition:
typedef  struct
{
  void     *GLOP_ptr,
  int       version,
  int       size,
  int       page,
  GLOP_Mode mode,
  GLOP_Type type,
}  GLOP_ref_t;
where:
  • GLOP_ptr specifies the mapped address of the GLOP data.
  • version specifies the version of the GLOP being used.

    This version reflects the GLOP_Version column in the DBCExtension.GLOP_Data table.

  • size specifies the length in bytes of the mapped GLOP data.

    Referencing outside the range could cause a memory violation.

  • page specifies the number of the mapped GLOP page.
  • mode specifies the mapping and modification mode, where the GLOP_Mode enumerated type has the following definition:
    typedef enum
      {
        GLOP_NONE=0, /* no map mode */
        GLOP_R=1,    /* read-only */
        GLOP_W=2,    /* normal map read/write */
        GLOP_M=3,    /* normal map global modify */
        GLOP_SW=4,   /* shared map read/write */
        GLOP_SM=5    /* shared map global modify */
      } GLOP_Mode;

    For details on the GLOP mapping and modification modes, see GLOP Data Attributes and GLOP Data Attributes.

  • type specifies the type of GLOP, where the GLOP_Type enumerated type has the following definition:
    typedef enum
     {
       GLOP_NULL=0, /* no mapping */
       GLOP_SY=1,   /* system GLOP */
       GLOP_RO=2,   /* role GLOP */
       GLOP_US=3,   /* user GLOP */
       GLOP_SE=4,   /* session GLOP */
       GLOP_TR=5,   /* transaction GLOP */
       GLOP_RE=6,   /* request GLOP */
       GLOP_XR=7    /* external routine GLOP */
     }  GLOP_Type;

    For details on the GLOP types, see GLOP Types.