Stings Size Limitation
I got a problem with an IN clause query with too many literals or String concatination
ex:
1 select listagg(rn,',') within group (order by 1)
2 from (
3 select rownum rn from dual connect by level < 2000
4* )
SQL> /
select rownum rn from dual connect by level < 2000
*
ERROR at line 3:
ORA-01489: result of string concatenation is too long
(or)
declare
l_empno varchar2(4000 char);
begin
select listagg(rn,',') within group (order by 1) into l_empno
from (
select rownum rn from dual connect by level < 2000);
l_empno := l_empno||','||l_empno;
select * into l_empno from emp where empno in l_empno;