Trouble with table name as parameter [message #1385030] |
Tue, 03 June 2014 19:40 |
Bob B Messages: 5 Registered: May 2014 |
Junior Member |
|
|
I am trying to create a monthly report. I have 12 tables, one for each month of data, all tables have exactly the same schema.
So I am trying to build a query where the table name is the parameter, which the user can select. This is the basic query:
Select <item, item,etc>
FROM tablename;
I have a combobox with the correct values for table names.
I have read about other people trying this, and the recommendation was to put the following code into the Before Open property:
this.queryText = this.queryText.replace("tablename", params["mytable"].value);
I tried this, but when I run the report, I get the following exception:
Failed to prepare the query execution for the data set: WmsMonthly Cannot set the string value (WMS_USAGE_01_2014) to parameter 1.
org.eclipse.birt.report.data.oda.jdbc.JDBCException: Cannot set preparedStatement parameter string value. SQL error #1:
The column index is out of range: 1, number of columns: 0. ; org.postgresql.util.PSQLException: The column index is out of range: 1, number of columns: 0.
-Even if I hard code a table name into the Before Open code, I get a similar message. It's as if the Before Open is being ignored.
Any suggestions?
|
|
|
|
Powered by
FUDForum. Page generated in 0.02936 seconds