traceWrite(java.lang.Object[] argv) - Advanced SQL Engine - Teradata Database

SQL External Routine Programming

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Published
July 2021
Language
English (United States)
Last Update
2021-07-27
dita:mapPath
rin1593638965306.ditamap
dita:ditavalPath
rin1593638965306.ditaval
dita:id
B035-1147
lifecycle
previous
Product Category
Teradata Vantage™

Called by a UDF or external stored procedure to write trace output into a temporary trace table defined by a CREATE GLOBAL TEMPORARY TRACE TABLE statement.

Each object in the argv array corresponds to a column in the trace table (beyond the first two mandatory columns). The order of the objects in the argv array matches the order of the columns in the trace table.

To use DbsInfo.traceWrite to write trace output into a temporary trace table, follow these steps:

  1. For each column in the trace table, create a Java object that maps to the SQL data type of the column and set the value of the object to the value you want to write to the column.

    For details on how Java objects map to the SQL data types of a temporary trace table column, see TraceObj Constructor.

  2. Wrap each Java object using the TraceObj wrapper class.

    For details on TraceObj, see com.teradata.fnc.TraceObj.

  3. Put the TraceObj objects into an Object array and pass the array to DbsInfo.traceWrite.

    DbsInfo.traceWrite converts the value of each object in the array to its corresponding SQL data type value and writes the value to the trace table.

FOR more information on … SEE …
debugging a Java UDF or external stored procedure using trace tables Debugging Using Trace Tables.
CREATE GLOBAL TEMPORARY TRACE TABLE Teradata Vantage™ - SQL Data Definition Language Syntax and Examples, B035-1144.