Routine Parameter List

Use the appropriate part of the Routine Parameter List segment whenever you see a reference to a Routine Parameter List in a syntax diagram.

Syntax

(1)
Routine Parameter List

1 + ,
2.1! IN
2.1 OUT
2.1  INOUT
1 %Parameter
Parameter

1 parameter
1 1
1 
2.1  %Subset of SQL Data Type2
2.1  LIKE table . column
1?  DEFAULT value
1  REFERENCES
2.1 BYTE
2.1 TEXT
1?  DEFAULT NULL
Notes:
Element Description Restrictions Syntax
column Name of a column whose data type is declared for parameter Must exist in the specified table Database Object Name
parameter Name of a parameter of the UDR Name is required for SPL routines Identifier
table Table that contains column The table must exist in the database Identifier
value Default used if UDR is called with no value for parameter Must be a literal, of the same data type as parameter. For opaque types, an input function must be defined Literal Number

Usage

A parameter is a formal argument in the declaration of a UDR. (When you subsequently invoke a UDR that has parameters, you must substitute a specific argument value for the parameter, unless the parameter has a default value.)

The name of the parameter is optional for external routines of HCL OneDB™.

When you create a UDR, you declare a name and data type for each parameter. You can specify the data type directly, or use the LIKE or REFERENCES clause to specify the data type. You can optionally specify a default value.

You can define any number of SPL routine parameters, but the total length of all parameters passed to an SPL routine must be less than 2 gigabytes.

No more than nine arguments to a UDR written in the Java™ language can be DECIMAL data types of SQL that the UDR declares as BigDecimal data types of the Java language.

Any C language UDR that returns an opaque data type must specify opaque_type in the var binary declaration of the C host variable.