Assignment Rules - Preprocessor2 for Embedded SQL

Teradata Preprocessor2 for Embedded SQL Programmer Guide

Product
Preprocessor2 for Embedded SQL
Release Number
15.10
Language
English (United States)
Last Update
2018-10-07
dita:id
B035-2446
lifecycle
previous
Product Category
Teradata Tools and Utilities

Rules for assigning the Teradata Database variables are documented in SQL Stored Procedures and Embedded SQL (B035‑1148).

When a character string variable is used as input to the Teradata 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 Teradata Database field is a SQL CHAR field and the length of the data value is less than the length of the Teradata Database field.

The Teradata Database field is blank padded.

The length is greater than that of the receiving field.

The data is truncated.

If the receiving Teradata Database field is a SQL VARCHAR and the actual length of the data is greater than the maximum length of the Teradata 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 Teradata Database field is a fixed character field (CHAR) and the length of the input data is less than the length of the Teradata Database field, causing blank padding. Trailing blanks are not stripped from the data when it is returned to the application.