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

String parameter in "in operator"


raquel

Recommended Posts

Hi

I have a String parameter that is put with "in operator" on SQL.

The query has (beetwen others) the following clauses:

where

...

AND ($P{IdOferta} = '0' OR OFERT_ID IN ($P!{IdOferta}) )

...

 

my code:

...

        String idOferta = req.getParameter("idOferta"); //    java.lang.String
        if (idOferta != null && !idOferta.equals("") && !idOferta.equals("")){
            parameters.put("IdOferta",idOferta);
        }
...

The problem is:

a) when I have idOferta=1234 everything is ok

b) when I have idOferta=1234,5678 there is no running error

c) when I have idOferta=1234,5678,9012 I get the following error:

net.sf.jasperreports.engine.JRException: Error executing SQL statement for : myReport]: java.sql.SQLException: ORA-01722: invalid number

Any suggestion?


Thanks in advance.

 

Link to comment
Share on other sites

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...