0
votes

I'm trying to create an Interactive Report where the where statement has an in clause.

Some like this.

Select column1,
       column2, 
       column3
from Table
where column1 in (1,2,3)

Column 1 is a number field in Oracle.

It works if there is only one value, but if there are multiples that are comma separated, then I get an ORA-01722: invalid number.

Is this not valid syntax in an APEX Interactive Report...

1
I suppose that your actual where clause looks like WHERE column1 IN (:P1_SOME_ITEM) ? - Tom
Yes, Sorry I left that out. I've tried application items and page items. It's the same issue when there is more than one value. - Jim
also, the values are comma separated, that are stored in P1_SOME_ITEM. - Jim

1 Answers

1
votes

This is not valid SQL - a common problem with a number of solutions. Here's one that uses regular expressions https://blogs.oracle.com/aramamoo/entry/how_to_split_comma_separated_string_and_pass_to_in_clause_of_select_statement