Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
queryText AFTER parameter substitution
cypherdj
Hi there,
is there a way to log the queryText of a data set after the parameter values have been substituted?
I added logging code in the beforeOpen and afterOpen and both log the query with ? in the place of the parameter values.
Regards,
Cedric
Find more posts tagged with
Comments
mwilliams
Hi Cedric,
I think the association of the parameter values to the '?'s in the query is done too deep in BIRT to be accessed by logging. Obviously, you could probably go into the source code and change it to return the query with the parameter values plugged in if you had the time.
The only other way I can think of would be if you could grab the query text and parameter values and plug them in yourself. The parameters are indexed somehow within BIRT, so if you can get the parameter value and parameter index, you should be able to do the association yourself.
Hopefully this'll help you out. I'll see if I can figure it out as well.
cypherdj
Indeed, I had a look at the Birt Log with FINEST log level, and it does log the query before param substitution, then it does report each query parameter value:<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
31-Jul-2008 11:31:43 org.eclipse.birt.report.data.oda.jdbc.Statement setTimestamp
FINE: parameter 1 = 2007-08-01 00:00:00.0
31-Jul-2008 11:31:43 org.eclipse.birt.report.data.oda.jdbc.Statement setTimestamp
FINE: parameter 2 = 2008-07-31 00:00:00.0
31-Jul-2008 11:31:43 org.eclipse.birt.report.data.oda.jdbc.Statement setString
FINE: parameter 3 = 'Settle Claim', 'Closed', 'Terminated', 'Claim Accepted', 'Claim Denied'
31-Jul-2008 11:31:43 org.eclipse.birt.report.data.oda.jdbc.Statement setTimestamp
FINE: parameter 4 = 2007-08-01 00:00:00.0
31-Jul-2008 11:31:43 org.eclipse.birt.report.data.oda.jdbc.Statement setTimestamp
FINE: parameter 5 = 2008-07-31 00:00:00.0
31-Jul-2008 11:31:43 org.eclipse.birt.report.data.oda.jdbc.Statement setTimestamp
FINE: parameter 6 = 2007-08-01 00:00:00.0
31-Jul-2008 11:31:43 org.eclipse.birt.report.data.oda.jdbc.Statement setTimestamp
FINE: parameter 7 = 2008-07-31 00:00:00.0
31-Jul-2008 11:31:43 org.eclipse.birt.report.data.oda.jdbc.Statement setString
FINE: parameter 8 = 'Settle Claim', 'Closed', 'Terminated', 'Claim Accepted', 'Claim Denied'
31-Jul-2008 11:31:43 org.eclipse.birt.report.data.oda.jdbc.Statement setString
FINE: parameter 9 = 'Settle Claim', 'Closed', 'Terminated', 'Claim Accepted', 'Claim Denied'
</pre>
<br />
However, parameter 3, 8 and 9 are subsituted inside an IN clause, and I'm suspecting this substitution does not work, as it's not finding Closed items for example.<br />
<br />
When I run what I expect the query to be against the same database, I do get Closed items.<br />
<br />
I was trying as much as possible to avoid scripting my data set, but it looks like that might be the only around this.<br />
<br />
Thanks,<br />
Cedric