Character Constants Treated as Variable-Length Strings (Record Mode) - Basic Teradata Query

Basic Teradata Query Reference

Product
Basic Teradata Query
Release Number
16.00
Published
November 2016
Language
English (United States)
Last Update
2018-04-25
dita:mapPath
hyz1479325149183.ditamap
dita:ditavalPath
Audience_PDF_include.ditaval
dita:id
B035-2414
lifecycle
previous
Product Category
Teradata Tools and Utilities

When a character constant is included in the SELECT statement’s item list, the constant is treated as a variable-length string. In Record Mode, this causes the constant to be prefixed with a two-byte field that defines the length of the character constant. This behavior affects how a record containing such constants is defined when imported later by BTEQ or another program.

To export a fixed-length character string, use a FORMAT phrase in the SQL SELECT statement. For example, the FORMAT phrase in the following SELECT statement causes the character constant 'First' to return as a fixed-length 30-character string:

SELECT 'First' (FORMAT 'X(30)');