Example: Poorly Formed Query Results - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
Language
English (United States)
Last Update
2024-04-03
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905

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, but because of the way the name was specified in the first SELECT, there was truncation.