Example - Analytics Database - Teradata Vantage

SQL Data Manipulation Language

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
ft:locale
en-US
ft:lastEdition
2024-12-13
dita:mapPath
pon1628111750298.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
esx1472246586715
lifecycle
latest
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.