
Column names longer than 30 bytes
You can define a column with a name longer than 30 bytes of EBCDIC, up to 128 bytes.
When the value of the TABLE_COL_NAME_EXPANSION subsystem parameter is ON, a column can be named, or reassigned a different name, longer than 30 EBCDIC bytes, and no warning is issued. For example, this can occur in the following situations:
- Statements for objects such as tables, views, or indexes that define new columns or rename existing columns.
- INSERT, UPDATE, DELETE or MERGE statements define include columns.
- Common table expressions that explicitly specify column names.
- An AS clause in a SELECT or FROM clause of a query defines an alternate name for a column of a result table.
Limitations for column names longer than 30 bytes
However, column names with a length greater than 30 bytes of EBCDIC might be truncated on a character boundary to at most 30 bytes when they are returned in an SQLDA. APIs that do not use the SQLDA to obtain a column name may return complete column names.
For example, the following interfaces, which use an SQLDA to get column names, will return at most 30 bytes of a column name:
- Direct use of an SQLDA
- SPUFI
- QMF
- DSNTEP2, DSNTEP4, DSNTIAD, DSNTIAUL, and DCLGEN
- ODBC APIs such as SQLDescribeCol and SQLColAttributes (or SQLColAttribute)
In other cases, an interface may not be supported, a truncated column name may unintentionally be interpreted by Db2 as a reference to another column that happens to have that truncated name, a warning may be returned with the truncated name, or an error may be returned rather than truncating the name.
