execute immediate
didn't support CLOBs until 11gR2. You can use DMBS_SQL
to handle larger statements. In earlier versions you could build up the statement, but 11g allows you to parse a CLOB.
There is an example here.
Creating a package dynamically seems like an odd requirement though.
Since you're on 10g, you will need to use the version of DBMS_SQL.PARSE that lets you build up large statements:
The PARSE procedure also supports the following syntax for large SQL
statements:
DBMS_SQL.PARSE (
c IN INTEGER,
statement IN VARCHAR2S,
lb IN INTEGER,
ub IN INTEGER,
lfflg IN BOOLEAN,
language_flag IN INTEGER);
Note: The procedure concatenates elements of a PL/SQL table statement
and parses the resulting string. You can use this procedure to parse a
statement that is longer than the limit for a single VARCHAR2 variable
by splitting up the statement.
An example of that approach here.