Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Trouble with table name as parameter(Trouble with table name as parameter)
Trouble with table name as parameter [message #1385030] Tue, 03 June 2014 19:40 Go to next message
Bob B is currently offline Bob BFriend
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?
Re: Trouble with table name as parameter [message #1385222 is a reply to message #1385030] Thu, 05 June 2014 04:29 Go to previous message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1925
Registered: July 2009
Senior Member

Can you attach your report design?

Michael

Developer Evangelist, Silanis
Previous Topic:How to use month as a parameter?
Next Topic:BIRT PDF creation not working need to install iText in BIRT 4.3.2 / Eclipse Kepler?
Goto Forum:
  


Current Time: Thu Apr 25 20:57:01 GMT 2024

Powered by FUDForum. Page generated in 0.02936 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top