Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ApEx How 2 turn a multiselect list value (eg. 1:2:3:4 ) into (1,2,3,4)

674229Dec 5 2008 — edited May 12 2011
ApEx newbie here,

I'm trying to get the output of a multi select list into an in list of a sql query for a report. The error message I'm getting is report error:
ORA-01722: invalid number. (The inlist is a list of id numbers, and the data type for this column in the database is NUMBER)

I've got a page item called P3_x which is populated from a MultiSelect list. I learned that these come out as colon delimited strings. (found a reference to hidden items in a blog that helped me figure this out)

So I created a hidden item called P3_x_in_list which does this:
Select '('|| regexp(:p3_x,':',',')||')' from dual which turns this into a comma separated list, like so: (1,2,3,4)

I put this hidden item, P3_X_IN_LIST into the sql in my report region

So in the report my sql looks like:

select a, b, c
from t1
where id in: P3_x_in_list
and some_date between :P1_X and :P2_X

For some reason it throws an invalid number error when it runs. I haven't been able to find anything in the documentation or on the web that sheds any light on this. I'm hoping that there is a benevolent, experienced developer that can point me in the right direction. The debuging information from the page is below:

Here is the debugging information
0.24: ...Session State: Save "P3_X" - saving same value: "1:2:3:4:5"
0.24: ...Session State: Save "P1_X" - saving same value: "01-DEC-2008"
0.24: ...Session State: Save "P2_X" - saving same value: "04-DEC-2008"
0.30: ...Session State: Save Item "P3_X_IN_LIST" newValue="(1,2,3,4,5)" "escape_on_input="N"
0.30: Processing point: ON_SUBMIT_BEFORE_COMPUTATION
...

0.46: show report
0.46: determine column headings
0.46: parse query as: my_schema
1.76: binding: ":P3_X_IN_LIST"="P3_X_IN_LIST" value="(1,2,3,4,5)"
2.64: binding: ":P2_X"="P2_X" value="04-DEC-2008"

report error:
ORA-01722: invalid number
ORA-02063: preceding line from my_schema


3.23: Computation point: AFTER_BOX_BODY
3.23: Processing point: AFTER_BOX_BODY



3.23: Computation point: BEFORE_FOOTER
3.23: Processing point: BEFORE_FOOTER
3.23: Show page tempate footer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 9 2011
Added on Dec 5 2008
6 comments
10,134 views