I've faced the following task: to parallel some process on Oracle 12c database. As always, I've started making this using dbms_parallel_execute package. Created a new task using dbms_parallel_execute.run_task procedure and passed my anonymous block with stored procedure call as sql_stmt parameter.
l_sql := 'BEGIN my_procedure(:start_id, :end_id); END;';
dbms_parallel_execute.run_task
(
task_name => l_task_name,
sql_stmt => l_sql,
language_flag => dbms_sql.native,
parallel_level => l_parallel_level
);
This stored procedure calls a couple of other procedures.
As a result, my "parent" procedure fails with the following exception:
PLS-00103: Encountered the symbol "." when expecting one of the following:
( begin case declare exit for goto if loop mod null pragma
raise return select update while with <an identifier>
<a double-quoted delimited-identifier> <a bind variable> <<
continue close current delete fetch lock insert open rollback
savepoint set sql execute commit forall merge pipe purge
The symbol "<an identifier>" was substituted for "." to continue.
As I found out, this exception throws because of EXECUTE IMMEDIATE call inside on of the procedures:
l_sql := 'BEGIN ' || some_another_pkg.schema_name || '.some_pkg.some_procedure(:1, :2); END;'
EXECUTE IMMEDIATE l_sql
USING l_param_1, l_param_2l
Where schema_name is a global variable of VARCHAR2(30) inside some_another_pkg package.
When I changed it to a forward procedure call, exception disappeared. But I can't replace this EXECUTE IMMEDIATE on a target environment.
Are there any workarounds to fix this issue without replacing EXECUTE IMMEDIATE call?
Thanks in advance.
get_packagevariable? - NonikaEXECUTE IMMEDIATEstatement? - TenGl_sqlvariable concatenates using a global variable in another package. - ahgpoug