15.00 - Memory Considerations for INOUT Parameters - Teradata Database

Teradata Database SQL Data Definition Language Detailed Topics

Teradata Database
Release Number
Content Type
Programming Reference
Publication ID
English (United States)

Memory Considerations for INOUT Parameters

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 SQL Data Manipulation Language for details and further examples.