I am working in an Oracle database and do not have direct access to our production database. I do have indirect access via a database link. The link is with the same user that all custom code runs under and has the same permissions as if I were to login directly as that user.
My question is, given this access, is it possible to compile a large stored procedure or package over the link/?
I found the function
dbms_utility.EXEC_DDL_STATEMENT
I am successful in using this to compile a procedure to the target database, however if the procedure is large, over 32k b, I get an error
[Error] Execution (1: 1): ORA-06502: PL/SQL: numeric or value error
ORA-06512: at line 21
Is it possible to send more than 32k b over to a target database and have the database compile the code? Here is a snippet of what I am trying to achieve
declare vsql NCLOB ;
i NUMBER := 0;
begin
FOR rec IN (
select * from all_source@dblink
where owner = :schema_owner
and name = :procedure_name
order by line asc
)
LOOP
vsql := vsql || rec.text;
--this outputs fine
DBMS_OUTPUT.put_line ('Record ' || i || ': ' || rec.text);
END LOOP;
--line errors with ORA-06502
dbms_utility.EXEC_DDL_STATEMENT@dblink(vsql);
end;