Jump to content
We've recently updated our Privacy Statement, available here ×

tschlat

Members
  • Posts

    2
  • Joined

  • Last visited

tschlat's Achievements

Newbie

Newbie (1/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare

Recent Badges

0

Reputation

  1. Meanwhile we have solved that issue by using a temporary table in which we insert the id's. Actually it is the same approach but without the necessity to pass a parameter into the stored procedure.
  2. Hello, i would like to get back to this issue because I have a similar problem. We are about to migrate our reports from Jasperreports version 3.3 to 4.0.1. Some of the reports work just fine without any modifications. But we have some reports which do not pass the query verifier due to the "Parameter type not supported in query" check. The problem is that we had implemented the query just the way it was suggested in this thread (using !P{}). But it turned out that our parameter list - in some cases grew to big. So it blasted the maximum stringlength of the parameter in the "in clause". At that time we solved the problem by defining a special type in our Oracle database and calling a stored procedure which uses this type as an input parameter. The value which is passed in is of type oracle.sql.ARRAY. It needs to be created via the database itself. We use a scriptlet for that. This solution worked fine in 3.3 and obviously passing an object of that type in the query actually makes sense. Now it does not work any more. Are there any suggestions that would help me find a quick solution? Thanks a lot in advance Thorsten Code:SQL:select* from SOME_TABLEwhere ID in (select * from TABLE($P{requestIdArray}))Scriptlet code:public void afterReportInit() throws JRScriptletException {Connection connection = (Connection) this.getParameterValue("REPORT_CONNECTION");ARRAY kiIdArray = null;ARRAY kiIdArray2 = null;try {Map reportParameterMap = (Map) this.getParameterValue("REPORT_PARAMETERS_MAP");Object arrayData = reportParameterMap.get("REQUEST_ID_ARRAY");Long[] longArray = (Long[])arrayData;ArrayDescriptor desc1 = ArrayDescriptor.createDescriptor("SPKTPRD.KID_TYPE",connection);kiIdArray = new ARRAY(desc1, connection, longArray);this.setVariableValue("requestIdArray", kiIdArray);reportParameterMap.put("requestIdArray", kiIdArray);Object arrayData2 = reportParameterMap.get("REQUEST_ID_ARRAY2");if (arrayData2!=null){Long[] longArray2 = (Long[])arrayData2;ArrayDescriptor desc2 = ArrayDescriptor.createDescriptor("SPKTPRD.KID_TYPE",connection);kiIdArray2 = new ARRAY(desc2, connection, longArray2);this.setVariableValue("requestIdArray2", kiIdArray2);}} catch (SQLException e) {e.printStackTrace();}}
×
×
  • Create New...