Cannot set the string value (value) to parameter 2. Invalid Column Index [message #1265171] |
Wed, 05 March 2014 19:47 |
Scott Williams Messages: 10 Registered: March 2014 |
Junior Member |
|
|
I apologize in advance for the (likely) trivial nature of my inquiry, I'm brand new to BIRT.
I'm getting the following error when I run a certain report:
Cannot set the string value (value) to parameter 2.
org.eclipse.birt.report.data.oda.jdbc.JDBCException: Cannot set preparedStatement parameter string value.
SQL error #1: Invalid column index
;
java.sql.SQLException: Invalid column index
at org.eclipse.birt.data.engine.odaconsumer.ExceptionHandler.newException(ExceptionHandler.java:54)
The report was running fine, but I'm trying to alter what options are available in the parameter drop-down list. Here are the queries for the 2 data sets I'm using:
select PART, PART_DESC, BIN_LOCATION, QTY, WAREHOUSE
from view_name
where
WAREHOUSE = ?
and DEPT_ID = 'department'
and BIN_ACTIVE = 'Y'
order by BIN_LOCATION
select DESCRIPTION, WAREHOUSE
from table_name
where ACTIVE = 'Y'
and dept_id = 'department'
--UNION
--select 'ALL', 'ALL' from dual
order by DESCRIPTION
There's also a report parameter, with a list box as the display type, string data type, and dynamic selection list.
One of the things I was trying to do was remove the "All" option form the drop-down, as it resulted in an extremely large report. That's why 2 of the lines are commented out on that 2nd query. If that was not the correct way to handle that, please let me know. The other thing I was trying to do is only allow warehouses from a specific department appear on the drop-down, instead of all departments. To do that I added: and dept_id = 'department'
Both queries run fine in Toad, what am I missing here? I'm using BIRT 2.6.1. Thank you.
|
|
|
|
Re: Cannot set the string value (value) to parameter 2. Invalid Column Index [message #1265811 is a reply to message #1265722] |
Thu, 06 March 2014 15:42 |
Scott Williams Messages: 10 Registered: March 2014 |
Junior Member |
|
|
donino donino wrote on Thu, 06 March 2014 08:20
Typically, this error occurs when there is a question mark '?' in the original query, which is dynamically removed by a script such beforeOpen. Check also if there are not empty parameters remaining in both datasets.
Also in your second query, how do you populate the value of dept_id? Should users select a department first in a dropdown, and then a warehouse within this department? In this case, you would need a cascading group
Thanks for the response. There are no scripts in this report, so that does not seem to be the problem. I'm sorry, can you clarify what you mean by "check also if there are not empty parameters remaining in both datasets"?
Dept_id is just a field in that table, I'm only wanting warehouses from a particular department to even appear in the parameter drop-down to begin with. Then, the user selects which warehouse they want to run the report on.
|
|
|
Re: Cannot set the string value (value) to parameter 2. Invalid Column Index [message #1815173 is a reply to message #1265811] |
Thu, 26 September 2019 15:38 |
Emanuele Spatola Messages: 11 Registered: September 2019 Location: Italy |
Junior Member |
|
|
Scott Williams wrote on Thu, 06 March 2014 16:42donino donino wrote on Thu, 06 March 2014 08:20
Typically, this error occurs when there is a question mark '?' in the original query, which is dynamically removed by a script such beforeOpen. Check also if there are not empty parameters remaining in both datasets.
Also in your second query, how do you populate the value of dept_id? Should users select a department first in a dropdown, and then a warehouse within this department? In this case, you would need a cascading group
Thanks for the response. There are no scripts in this report, so that does not seem to be the problem. I'm sorry, can you clarify what you mean by "check also if there are not empty parameters remaining in both datasets"?
Dept_id is just a field in that table, I'm only wanting warehouses from a particular department to even appear in the parameter drop-down to begin with. Then, the user selects which warehouse they want to run the report on.
Did you find any solution?
|
|
|
Powered by
FUDForum. Page generated in 0.03135 seconds