15.10 - Example: Query Band UPDATE Examples - Teradata Database

Teradata Database SQL Data Definition Language Syntax and Examples

prodname
Teradata Database
vrm_release
15.10
created_date
December 2015
category
Programming Reference
featnum
B035-1144-151K

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;