Example: Using DBC.QryLogEventHisV - Advanced SQL Engine - Teradata Database

Data Dictionary

Product
Advanced SQL Engine
Teradata Database
Release Number
17.00
Published
June 2020
Language
English (United States)
Last Update
2020-10-15
dita:mapPath
yoz1556235523563.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1092
lifecycle
previous
Product Category
Teradata Vantage™

The following is an example SQL statement that demonstrates how data can be extracted from the QryLogEventHisV view to give an explanation of the expression and events which caused a RED SysCon.

WITH RECURSIVE
 CausalAnalysis(EntryTS,
         EntryKind, EntryID, EntryName, Activity, ActivityId) AS
 (
  SELECT EntryTS,
      EntryKind, EntryID, EntryName, Activity, ActivityId
  FROM DBC.QryLogEventHisV
  WHERE EntryKind = 'SYSCON'
    AND EntryName = 'RED'
    AND Activity = 'ACTIVE'
 UNION ALL
  SELECT Cause.EntryTS,
      Cause.EntryKind,
      Cause.EntryID,
      Cause.EntryName,
      Cause.Activity,
      Cause.ActivityId
  FROM CausalAnalysis Condition INNER JOIN
     DBC.QryLogEventHisV Cause
     ON Condition.EntryKind = Cause.ActivityId AND
      Condition.EntryID = Cause.ActivityId
 )
SELECT *
FROM CausalAnalysis
ORDER BY 1 DESC;