Example - Advanced SQL Engine - Teradata Database

SQL Data Manipulation Language

Product
Advanced SQL Engine
Teradata Database
Release Number
17.00
Published
September 2020
Language
English (United States)
Last Update
2021-01-23
dita:mapPath
qtb1554762060450.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1146
lifecycle
previous
Product Category
Teradata Vantage™

This example demonstrates how a poorly formed query can cause truncation of the results.

   SELECT level, param, 'GMKSA       ' (TITLE 'OWNER')
   FROM gmksa
   WHERE cycle = '03'
   UNION
   SELECT level, param,'GMKSA CONTROL'
   FROM gmksa_control
   WHERE cycle = '03'
   ORDER BY 1, 2;

This query returns the following answer set:

   ***QUERY COMPLETED.10 ROWS FOUND. 3 COLUMNS RETURNED.
   LEVEL   PARAM   OWNER
   -----   -----   ------------ 
   00      A       GMKSA
   00      A       GMKSA CONTRO
   00      T       GMKSA
   00      T       GMKSA CONTRO
   85      X       GMKSA
   85      X       GMKSA CONTRO
   SF      A       GMKSA
   SF      A       GMKSA CONTRO
   SF      T       GMKSA
   SF      T       GMKSA CONTRO 

This query returned the expected rows; note, however, that because of the way the name was specified in the first SELECT, there was some truncation.