Memory Considerations for INOUT Parameters | CREATE/REPLACE PROCEDURE | Vantage - 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
2024-10-04
dita:mapPath
vuk1628111288877.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
jbg1472252759029
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, the system treats it as an overflow for a SMALLINT irrespective of the data type assigned to the parameter when the procedure was created, aborts the request, and 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 for details and further examples.