Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
beforeOpen
jlux33
I am getting this error when trying to add a very simple beforeOpen query adjustment:
org.eclipse.birt.report.engine.api.EngineException: Cannot get the result set metadata. org.eclipse.birt.report.data.oda.jdbc.JDBCException: SQL statement does not return a ResultSet object. SQL error #1:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'undefined WHERE A.InvoiceNumber = '771990'' at line 1 ; com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'undefined WHERE A.InvoiceNumber = '771990'' at line 1
The beforeOpen is simply this:
<method name="beforeOpen"><![CDATA[
var whereClause = "";
if (params["VendorName"].value != "" && params["VendorName"] != null) {
whereClause = " WHERE A.InvoiceNumber = '771990'";
this.queryText = this.QueryText + whereClause;
}
]]></method>
The VendorName parameter is a "Not Required" string.
Report is also attached.
Find more posts tagged with
Comments
kclark
I'm getting the same thing when trying to do something similar to recreate it. One way to work around the error is to put the entire query in a variable and do something like this<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
var query = "select * from customers where customernumber = " + params["NewParameter"];
this.queryText = query;</pre>
johnw
this.queryText is case sensitive since it is a variable name. this.QueryText is not the same as this.queryText.
I would use Property Binding instead.
jlux33
That was it...duh.
Thanks a lot.
Jim