17.05 - Example: Creating a Java External Stored Procedure Using a Structured UDT - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Data Definition Language Syntax and Examples

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
Release Date
January 2021
Content Type
Programming Reference
Publication ID
B035-1144-175K
Language
English (United States)
This statement creates a structured UDT named CIRCLE:
CREATE TYPE CIRCLE AS (x double, y double, r double);
This statement creates a Java external stored procedure using the CIRCLE structured UDT as the data type for the input parameter A1:
CREATE PROCEDURE MyCircle(IN A1 CIRCLE, OUT A2 INTEGER)
      LANGUAGE JAVA
      NO SQL
      PARAMETER STYLE JAVA 
      EXTERNAL NAME 
     	'UDF_JAR:UserDefinedFunctions.mycircle';
public static void mycircle(java.sql.Struct A1, int[] A2) throws SQLException