16.20 - Example: Query Band UPDATE Examples - Teradata Database - Teradata Vantage NewSQL Engine

Teradata Vantage™ SQL Data Definition Language Syntax and Examples

Product
Teradata Database
Teradata Vantage NewSQL Engine
Release Number
16.20
Published
March 2019
Content Type
Programming Reference
Publication ID
B035-1144-162K
Language
English (United States)
Last Update
2019-05-24

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;