Example: Setting the Transaction Query Band Using a Parameter - Analytics Database - Teradata Vantage

SQL Data Definition Language Syntax and Examples

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2024-10-04
dita:mapPath
jco1628111346878.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
mdr1472255012272
lifecycle
latest
Product Category
Teradata Vantage™

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;

Result:

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