17.10 - Example: Creating a Java External Stored Procedure Using an ARRAY or VARRAY Data Type - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Data Definition Language Syntax and Examples

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Release Date
July 2021
Content Type
Programming Reference
Publication ID
B035-1144-171K
Language
English (United States)
This statement creates a UDT named phonenumbers_ary:
CREATE TYPE phonenumbers_ary AS CHAR(10) ARRAY[5];
This statement creates a Java external stored procedure using the phonenumbers_ary UDT as the data type for the input parameter A1:
REPLACE PROCEDURE getPhoneNum(IN A1 phonenumbers_ary, 
                              IN EMPID INTEGER, OUT myphonenum INTEGER)
        LANGUAGE JAVA
        NO SQL
        PARAMETER STYLE JAVA 
        EXTERNAL NAME 
        'UDF_JAR:UserDefinedFunctions.getPhoneNums';

public static void getPhoneNums(java.sql.Array A1, int empid, int[] myphonenum)