Example: Select JSON Data from QryLogParamJSON - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
ft:locale
en-US
ft:lastEdition
2024-12-11
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905

This example assumes the PARAMINFO option is enabled in the BEGIN/REPLACE QUERY LOGGING statement. The SELECT statement selects data from QryLogParamJSON and converts all rows in the DBC.DBQLParamTbl table to a JSON document.

Run this query from BTEQ with width set to 500.

.width 500;
select QueryID, RowNum, ParamJSON from QryLogParamJSON;

Result:

QueryID            RowNum ParamJSON
------------------ ------ -------------------------------------------------------------
307190733539634351 1      {"QueryID":"307190733539634351","HostCharSet":"127",
                          "ParamInfo":[{"Name":"x","Type":"INTEGER","Size":4,
                          "Position":1}]}
307190733539634351 2      {"QueryID":"307190733539634351","Data Record":{"x":"10"}}