Examples | Heatmap Table Function and Macro | Teradata Vantage - Example: Using the tdheatmap Function - Advanced SQL Engine - Teradata Database

SQL Operators and User-Defined Functions

Product
Advanced SQL Engine
Teradata Database
Release Number
17.00
Published
September 2020
Language
English (United States)
Last Update
2023-04-27
dita:mapPath
qqu1556127655717.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1210
lifecycle
previous
Product Category
Teradata Vantage™

You can use the tdheatmap function to return just a few important columns, like the table name, cylinder ID, and temperature.

SELECT date TheDate,
       t1.ampnumber,
       dbase.databasenamei DatabaseName, 
       tvm.tvmnamei TableName, 
       to_byte(t1.cylinderidmsw) || to_byte(t1.cylinderidlsw) CylinderId,
       t1.temperature
FROM TABLE(tdheatmap(2)) AS t1,
     dbc.tvm tvm,
     dbc.dbase dbase
WHERE t1.starttableiduniq = tvm.tvmid
AND   tvm.databaseid = dbase.databaseid;
TheDate AmpNumber DatabaseName TableName CylinderId Temperature
11/10/2016 2 TD_SYSFNLIB BITNOT 00-06-00-02-00-00-00-05 10.58
11/10/2016 2 DW123 ALPHA 00-06-00-02-00-00-00-46 10
11/10/2016 2 TD_SYSFNLIB WEEKNUMBER_ OF_ CALENDAR_TSWZ 00-06-00-02-00-00-00-45 17.83
11/10/2016 2 DW123 ALPHA 00-06-00-02-00-00-00-49 10
11/10/2016 2 DBC CHANGEDROWJOURNAL 00-06-00-02-00-00-00-21 10.06
11/10/2016 2 DW123 ALPHA 00-06-00-02-00-00-00-4A 10
11/10/2016 2 DBC ALL 00-06-00-02-00-00-00-23 10
11/10/2016 2 DW123 ALPHA 00-06-00-02-00-00-00-47 10
11/10/2016 2 DBC TVFIELDS 00-06-00-02-00-00-00-3A 10.21
11/10/2016 2 DW123 MILLIONS 00-06-00-02-00-00-00-4B 10
11/10/2016 2 DW123 ALPHA 00-06-00-02-00-00-00-48 10
11/10/2016 2 DW123 ALPHA 00-06-00-02-00-00-00-4E 10