Memory Considerations for INOUT Parameters - Analytics Database - Teradata Vantage

SQL Data Definition Language Detailed Topics

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2023-07-11
dita:mapPath
vuk1628111288877.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
B035-1184
lifecycle
latest
Product Category
Teradata Vantage™

If the size of an output value returned to an INOUT parameter is larger than the memory the system had allocated for the input value for that parameter when the procedure was called, the CALL request fails and returns an overflow error to the requestor.

The following example illustrates this. Suppose you have created a procedure named myintz with a single INOUT parameter.

CALL myintz(32767);

The smallest data type the system can use to store 32,767 is SMALLINT, so it allocates the 2 bytes required to store a SMALLINT number for the parameter. If this CALL request returns a value greater than or equal to 32,768 to the INOUT parameter, the system treats it as an overflow for a SMALLINT, irrespective of the data type assigned to the parameter when it was created, returns an error because the largest positive value that a SMALLINT variable can contain is 32,767.

See CALL in Teradata Vantage™ - SQL Data Manipulation Language, B035-1146.