Memory Considerations for INOUT Parameters - Advanced SQL Engine - Teradata Database

SQL Data Definition Language Detailed Topics

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Published
July 2021
Language
English (United States)
Last Update
2021-07-27
dita:mapPath
imq1591724555718.ditamap
dita:ditavalPath
imq1591724555718.ditaval
dita:id
B035-1184
lifecycle
previous
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.