TITLE Attribute for Data Columns Teradata

Compatibility: Teradata Extension

As seen earlier, an alias may be used to change the column name. This can be done for ease of reference or to alter the heading for the column in the output. The TITLE is an alternative to using an alias name when a column heading needs to be changed. There is a big difference between TITLE and an alias. Although an alias does change the title on a report, it is normally used to rename a column (throughout the SQL) as a new name. The TITLE only changes the column heading. The syntax for using TITLE follows:

Like FORMAT, TITLE changes the attribute of the displayed data. Therefore, it is written in parentheses also. Also like FORMAT, tools using the ODBC may not work as well as they do in BTEQ, the report writer. This is especially true when using the // stacking symbols. In tools like Queryman, the title literally contains // and is probably not the intent. Also, if you attempt to use TITLE in Queryman and it does not work, there is a configuration option in the ODBC. When "Use Column Names" is checked, it will not use the title designation.

The following SELECT uses the TITLE to show the result:

1 Row ReturnedSELECT uses the TITLE to show the result

Notice that the word ‘Character’ is stacked over the ‘Data’ portion of the heading for the second column using BTEQ. So, as an alternative, a TITLE can be used instead of an alias and allows the user to include spaces in the output title.

Another neat trick for TITLE is to use two single quotes together (TITLE ‘’). This technique creates a zero length TITLE, or no title at all, as seen in the next SELECT:

1 Row ReturnedSELECT uses the TITLE to show the result

Remember, this TITLE is two separate single quotes, not a single double quote. A double quote by itself does not work because it is unbalanced without a second double quote.

Face Book Twitter Google Plus Instagram Youtube Linkedin Myspace Pinterest Soundcloud Wikipedia

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

Teradata Topics