Data Type for INOUT Constant Arguments - Analytics Database - Teradata Vantage

SQL External Routine Programming

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
iiv1628111441820.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
B035-1147
lifecycle
latest
Product Category
Teradata Vantageā„¢

The data type for an INOUT constant argument is governed by the data type of the value passed in, not what is defined. If the data type of the value passed in is smaller than the data type defined in the CREATE PROCEDURE or REPLACE PROCEDURE statement, and the external stored procedure returns a value larger than the maximum value of the data type for the value passed in, the system returns an overflow error.

For example, consider an external stored procedure that defines an INTEGER INOUT parameter:

   CREATE PROCEDURE inout_example( INOUT p1 INTEGER )
   LANGUAGE C
   NO SQL
   PARAMETER STYLE SQL
   EXTERNAL;

If you call the external stored procedure with a constant input value that fits into a SMALLINT, the system returns an overflow error if the output value is larger than 32767, the maximum value of a SMALLINT:

   CALL inout_example(1000);