Transaction QUERY_BAND not working

Database
Teradata Employee

Transaction QUERY_BAND not working

Whenever I set a Transaction Query_Band, the only statement recorded in QryLog table is the SET QUERY_BAND= statement. The following SQL transaction does have the Transaction QueryBand Name/Value pair associated with it.

By Example:

SET QUERY_BAND='STEP=1.0;' FOR TRANSACTION

;insert into DBA_SANDBOX.EPIC21_gt_svc_agmt_sample_list

...

From Query Log Table:





QueryBand QueryText
=S> Jobname=EPIC21;benchmark=TestQB; SET QUERY_BAND = 'Jobname=EPIC21;benchmark=TestQB;
=T> STEP=1.0; =S> Jobname=EPIC21;benchmark=TestQB; SET QUERY_BAND = 'STEP=1.0;' FOR TRANSACTION ;                                                      
=S> Jobname=EPIC21;benchmark=TestQB; INSERT INTO DBA_SANDBOX.EPIC21_g
=T> STEP=1.1; =S> Jobname=EPIC21;benchmark=TestQB; SET QUERY_BAND = 'STEP=1.1;' FOR TRANSACTION ;                                                      
=S> Jobname=EPIC21;benchmark=TestQB; collect statistics on             
 
3 REPLIES
Teradata Employee

Re: Transaction QUERY_BAND not working

How are you submitting these statements? The semicolon at the start of the line is BTEQ-specific syntax for a multistatement request.

Teradata Employee

Re: Transaction QUERY_BAND not working

So, your right, it is more like BTEQ. So far, the only way I can get it work is to use BT/ET and set the transaction qb as the first statement after the BT; statement.

Seems to be cumbersome, especially if you have many sequences where you need to change the qb for each transaction.

Any thoughts?

Example:

BT;

 SET QUERY_BAND='STEP=3.2;' UPDATE FOR TRANSACTION;

 collect statistics on temporary DBA_SANDBOX.EPIC21_gt_usg_list column (sp_id, usg_dt, int_hour, ener_dir_cd, wea_stn_cd);

ET;

Enthusiast

Re: Transaction QUERY_BAND not working

You can use a simple 

BEGIN CODE;

--Set Query Band

Multiple statements.

END CODE;

Let me know if it doesnt work.