17.10 - Example: Setting the Transaction Query Band Using a Parameter - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Data Definition Language Syntax and Examples

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Release Date
July 2021
Content Type
Programming Reference
Publication ID
B035-1144-171K
Language
English (United States)

Both of the following procedures set the transaction query band using a parameter named qbin:

     CREATE PROCEDURE setqbmsr(
       IN qbin VARCHAR(60))
      BEGIN REQUEST
        SET QUERY_BAND = :qbin FOR TRANSACTION;
        INS abc(1,2);
      END REQUEST;

     CREATE PROCEDURE qbparm1 (
       IN  par1 INTEGER,
       IN  qbin VARCHAR(60),
       OUT qbout VARCHAR(60))
      BEGIN REQUEST
       BEGIN TRANSACTION;
        SET QUERY_BAND = :qbin FOR TRANSACTION;
        SELECT GetQueryBand() INTO qbout;
       END TRANSACTION;
      END REQUEST;

     CALL qbparm1(10, 'kid=kate;', par3);
       *** Procedure has been executed. 
       *** Total elapsed time was 1 second.
     qbout
     ------------------------------------------------------------
     =T> kid=kate;