multiselect list causing ORA-01704: string literal too long
COct 13 2008 — edited Nov 7 2008I have a page that uses a multiselect list. Based on the items chosen, a report will be generated. The items chosen go into an IN clause. The number of items can be a couple thousand and the character size can be > 16000. The report is a PL/SQL function body returning SQL query. Example of query is below
declare
q varchar2(32767);
orig_string varchar2(32767);
l_vc_arr2 HTMLDB_APPLICATION_GLOBAL.VC_ARR2;
begin
l_vc_arr2 := HTMLDB_UTIL.STRING_TO_TABLE(:P4_ITEMS);
orig_string := HTMLDB_UTIL.TABLE_TO_STRING(l_vc_arr2,',');
q := 'SELECT a,b,c '||
'FROM msg ' ||
'where '||
'a IN ('|| 'SELECT * FROM TABLE ( cast( LISTFUNC('''||orig_string||''') as instType ) )) ';
return q;
end;
instType is a type of table varchar2(4000)
It looks like the string to table and table to string are used just to get a comma delimited list (replace should've been able to do the same as well)...
How do you deal with a string that is so long in Apex? I've tried substr, etc. So I either get string literal too long or ORA-01460: unimplemented or unreasonable conversion requested
Thank you,
-Carmine