- Connect to Teradata Database using SQLA or Studio.
- Execute the following statement to enable query band on the session:
/*enable query band*/SET QUERY_BAND = ‘QUERY=Test;ApplicationName=SQLA;’ FOR SESSION ;
- Now execute any query from SQLA; all the queries associated with the current session will now be executed under this query band:
/*sample query*/Sel * from dbc.dbase
- Now you can retrieve all the queries under this query band from DBQL as follows:
/*Get queries under query band*/sel query band, querytext,sessionidfrom dbc.dbqlogtblwhere trim(query band) LIKE ‘%ApplicationName%’;