15.10 - Assignment Rules - Preprocessor2 for Embedded SQL

Teradata Preprocessor2 for Embedded SQL Programmer Guide

prodname
Preprocessor2 for Embedded SQL
vrm_release
15.10
category
Programming Reference
featnum
B035-2446-035K

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.