C Scalar Function Using TD_ANYTYPE Parameters | UFC Code Examples | Vantage - C Scalar Function Using TD_ANYTYPE Parameters - Advanced SQL Engine - Teradata Database

SQL External Routine Programming

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Published
July 2021
Language
English (United States)
Last Update
2021-07-27
dita:mapPath
rin1593638965306.ditamap
dita:ditavalPath
rin1593638965306.ditaval
dita:id
B035-1147
lifecycle
previous
Product Category
Teradata Vantageā„¢
This example shows the C code for a simple scalar function that uses TD_ANYTYPE input and result parameters. This function returns the ASCII numeric value of the first character of the input string. It accepts input strings with the following data types:
  • CHARACTER
  • VARCHAR
  • CLOB
  • UDT with a CHARACTER, VARCHAR, or CLOB attribute.
  • ARRAY with an element type of CHARACTER or VARCHAR.

The function accepts the character set associated with the input string. If no character set is explicitly specified, the default character set is used.

The return type supported by this function is BYTEINT, SMALLINT, or INTEGER. To specify the desired return type for the function, use the RETURNS data type or RETURNS STYLE column expression clause when invoking the function.