The set of name:value pairs applies to the current session.
You can set a session query band concurrently with an existing transaction query band.
Session query bands are stored in DBC.SessionTbl and are recovered after a system reset. The system populates additional columns in DBC.SessionTbl for a trusted session and uses the information in these session proxy columns to recover a trusted session after a system reset.
- SET QUERY_BAND = … FOR SESSION request to reset the query band.
- SET QUERY_BAND = NONE FOR SESSION request.
- In a macro definition, as the single request in the macro.
- With Teradata Parallel Transporter.
- Multistatement requests.
- SQL procedure definitions.
All reserved query bands associated with a load or unload utility should be set FOR SESSION to enable their operation across a restart. For more information about reserved query bands, see “SET QUERY_BAND” in SQL Data Definition Language - Detailed Topics, B035-1184 and Teradata Virtual Storage, B035-1179.
- The system does not update the queryband column of DBC.SessionTbl and the FOR SESSION request is equivalent to a FOR TRANSACTION request.
- Use caution if you mix SET QUERY_BAND requests. For example, an application can set some name:value pairs FOR SESSION that are saved in DBC.SessionTbl. If you then add query band name:value pairs using the SET QUERY_BAND VOLATILE option, the query band in the DBC.SessionTbl will no longer match the current session query band. In this case, the system restores the query band saved in DBC.SessionTbl on a restart.