Hi,

I am trying to use the EXECUTE IMMEDIATE statement, but as soon as my SQL is bigger than 4000, than I get ORA-01704: string literal too long

A test script:

DECLARE
SQ VARCHAR2(32000);
L_SQL VARCHAR2(32000);
N NUMBER;
BEGIN

SQ := '';

FOR N IN 1 .. 30000 LOOP
SQ := CONCAT(SQ , 'B');
END LOOP;


L_SQL := CONCAT('SELECT ''', SQ);
L_SQL := CONCAT(L_SQL,''' FROM DUAL');

EXECUTE IMMEDIATE L_SQL;
END;

How can I solve this problem?

Thanx
Leon de Jager
South Africa