Host to Server Assignment - Teradata Preprocessor2

Teradata® Preprocessor2 for Embedded SQL Programmer Guide

Product
Teradata Preprocessor2
Release Number
17.00
Published
June 2020
Language
English (United States)
Last Update
2020-06-19
dita:mapPath
whb1544831946911.ditamap
dita:ditavalPath
obe1474387269547.ditaval
dita:id
B035-2446
lifecycle
previous
Product Category
Teradata Tools and Utilities

Host variables can be used to pass column values to the server with the VALUES clause of the INSERT statement or the SET clause of the UPDATE statement.

Except for character string data, PP2 performs no conversion before sending the data to the server, so the application must ensure that the host variable can pass the value to the server for conversion.

Assignment Rules

Rules for assigning the database variables are documented in Teradata Vantage™ - SQL Stored Procedures and Embedded SQL , B035-1148 .

When a character string variable is used as input to the database, the data is scanned for the first '\0', which determines the length of the data.

Condition Result
No '\0' is found. Error code -302 is placed in the SQLCODE.
The receiving database field is a SQL CHAR field and the length of the data value is less than the length of the database field. The database field is blank padded.
The length is greater than that of the receiving field. The data is truncated.

If the receiving database field is a SQL VARCHAR and the actual length of the data is greater than the maximum length of the database field, the data is truncated; otherwise, the resulting length of the SQL field is the actual length of the data value.

The data returned can be greater than the length of the data at input. This condition occurs when the database field is a fixed character field (CHAR) and the length of the input data is less than the length of the database field, causing blank padding. Trailing blanks are not stripped from the data when it is returned to the application.