Specifying the C/C++ Function Name - Advanced SQL Engine - Teradata Database

SQL External Routine Programming

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-24
dita:mapPath
qwr1571437338192.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1147
lifecycle
previous
Product Category
Teradata Vantage™

The CREATE PROCEDURE statement provides clauses that identify the C/C++ function name that appears immediately before the left parenthesis in the C/C++ function declaration or the function entry name when the C/C++ object is provided instead of the C/C++ source.

IF CREATE PROCEDURE specifies … THEN …
EXTERNAL The C/C++ function name must match the name that follows the CREATE PROCEDURE keywords.

Consider the following CREATE PROCEDURE statement:

CREATE PROCEDURE GetRegionXSP
  (INOUT region VARCHAR(64))
LANGUAGE C
NO SQL
EXTERNAL
PARAMETER STYLE TD_GENERAL;

The C function name must be GetRegionXSP.

If the client is mainframe-attached, then the C/C++ function name must be the DDNAME for the source.

EXTERNAL NAME function_name the C/C++ function name must match function_name.

Consider the following CREATE PROCEDURE statement:

CREATE PROCEDURE GetRegionXSP
  (INOUT region VARCHAR(64))
LANGUAGE C
NO SQL
EXTERNAL NAME xsp_getregion
PARAMETER STYLE TD_GENERAL;

The C function name must be xsp_getregion.

If the client is mainframe-attached, then function_namemust be the DDNAME for the source.

EXTERNAL NAME 'string' 'string' can include the F option to specify the C/C++ function name.

Consider the following CREATE PROCEDURE statement:

CREATE PROCEDURE GetRegionXSP
  (INOUT region VARCHAR(64))
LANGUAGE C
NO SQL
EXTERNAL NAME 'CS!getregion!xspsrc/getregion.c!F!xsp_getregion'
PARAMETER STYLE TD_GENERAL;

The C function name must be xsp_getregion.

If 'string' does not include the F option, then the C/C++ function name must match the name that follows the CREATE PROCEDURE keywords.