17.10 - Example: Creating a Java External Stored Procedure Using a Distinct UDT - 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 distinct UDT named MONEY:
CREATE TYPE MONEY AS numeric(10,2) FINAL;
This statement creates a Java external stored procedure using the MONEY distinct UDT as the data type for the input parameter A1 and the output parameter A2:
CREATE PROCEDURE MyMoney(IN A1 MONEY, OUT A2 MONEY)
     LANGUAGE JAVA
     	NO SQL
     PARAMETER STYLE JAVA 
     	EXTERNAL NAME 
     'UDF_JAR:UserDefinedFunctions.mymoney';
public static void mymoney(java.lang.BigDecimal A1, 
                       java.lang.BigDecimal[] A2) throws SQLException