Teradata provides a UDF called GetQueryBand and an external stored procedure called GetQueryBandSP that retrieve the query band using the FNC_GetQueryBand library function. GetQueryBand and GetQueryBandSP are created in the SYSLIB database when you execute the DIPDEM script using the DIP utility.
For more information on DIP, see Teradata Vantage™ - Database Utilities, B035-1102. For more information on GetQueryBand and GetQueryBandSP, see Teradata Vantage™ - Application Programming Reference, B035-1090.