17.00 - Example: Using QryLogSQL - Teradata Database

Teradata Vantage™ - Data Dictionary

prodname
Advanced SQL Engine
Teradata Database
vrm_release
17.00
created_date
June 2020
category
Administration
Programming Reference
featnum
B035-1092-170K

The following SELECT statement retrieves the SQL text information of a query.

                 SELECT QueryID, SqlRowNo, SqlTextInfo from DBC.QryLogSQL
                   WHERE QueryId=201205134619838024;

Result:

QueryID            SqlRowNo SqlTextInfo
------------------ -------- ----------------------------
201205134619838024 1        CREATE TABLE table1A,
                             FALLBACK, NO BEFORE JOURNAL, 
                             NO AFTER JOURNAL (i INTEGER, 
                             i2 INTEGER)  
                             PRIMARY INDEX( i );
The SQL text is not edited to remove any blanks; it is stored the same way you entered the text.