Example: Query Band UPDATE Examples - Advanced SQL Engine - Teradata Database

SQL Data Definition Language Syntax and Examples

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
Published
January 2021
Language
English (United States)
Last Update
2021-01-22
dita:mapPath
ncd1596241368722.ditamap
dita:ditavalPath
hoy1596145193032.ditaval
dita:id
B035-1144
lifecycle
previous
Product Category
Teradata Vantage™

This example set demonstrates how to specify and use the query band UPDATE option.

This example uses the UPDATE option to add the name:value pairs city:san diego and state:california.

     SET QUERY_BAND = 'city=san diego;' UPDATE FOR SESSION;
     GETQUERYBAND()
     -----------------------------------------------------------------
     =S> city=san diego;
     SET QUERY_BAND = 'state=california;' UPDATE FOR SESSION;
     GETQUERYBAND()
     -----------------------------------------------------------------
     =S> state=california;city=san diego;

This example uses UPDATE to change the value of the name:value pair city:san diego to city:fresno.

     SET QUERY_BAND = 'city=Fresno;' UPDATE FOR SESSION;
     GETQUERYBAND()
     -----------------------------------------------------------------
     =S> 'city=Fresno;state=california;

This example replaces the entire query band by not specifying the UPDATE option.

     SET QUERY_BAND = 'ID=k31293; Job=payroll;' FOR SESSION;
     GETQUERYBAND()
     -----------------------------------------------------------------
     =S> ID=k31293;Job=payroll;