All Forums Database
Wonder 2 posts Joined 05/11
18 May 2015
JDBC queries on Teradata not logged in DBQLogTbl with parameters.

We have an application that connects to Teradata via JDBC and executes queries using PreparedStatements.
However, when logging is enabled for the application user, the QuertText in DBQLogTbl doesn't show the actual query with values of variables(see below)
select col1 from tab2 where col3=? and col4=?
I need to see the final query with actual values substituted for the variables. Please let me know if there is any configuration that would enable to see the complete query.

dnoeth 4628 posts Joined 11/04
18 May 2015

What's your Teradata release?
Before TD15 there's no way to get this info.
In TD15 there's Begin Query Logging with PARAMINFO which logs into the new DBC.DBQLParamTbl.


tomnolan 594 posts Joined 01/08
18 May 2015

First, let's clear up a misconception. The parameterized query with question-mark parameter markers is the "final" query. The Teradata Database does not rewrite the query and replace the parameters with literal values. The parameter values are kept separate from the parameterized query.
Dieter is correct that you can see the parameter values with the Teradata Database 15.0 feature "Begin Query Logging with ParamInfo". Please keep in mind that feature logs the parameter values, but does not log a modified version of the query that has literals substituted for the parameter markers.

Wonder 2 posts Joined 05/11
18 May 2015

Thank you Dieter and Tomnolan..that helps !

bilal.farooq 28 posts Joined 08/10
12 Jul 2016

The ParamInfo. column in table DBC.DBQLParamTbl is a BLOB. How can we view it ?

You must sign in to leave a comment.