Not in the matter of length, only the number of its operations. This figure is sufficiently high for most commands. The error message would reveal it to you, but as you did not post it here, I cannot say if you hitted it.
When (ab)using dynamic execution of the query in PL/SQL (execute immediate), you are limited to the VARCHAR2 limit, which is 32767 bytes.
Again, as I do not know the failure reason, I cannot say more (as I hate guessing).
Native dynamic SQL using the EXECUTE IMMEDIATE and OPEN-FOR statements is faster and requires less coding than the DBMS_SQL package. However, the DBMS_SQL package should be used in these situations:
* There is an unknown number of input or output variables, such as the number of column values returned by a query, that are used in a dynamic SQL statement (Method 4 for dynamic SQL).
* The dynamic code is too large to fit inside a 32K bytes VARCHAR2 variable.