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.
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.
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.
The ParamInfo. column in table DBC.DBQLParamTbl is a BLOB. How can we view it ?