Using the WITH_PLSQL hint
We need a demonstration table:
create table tq84_t (n number);
The following statement causes ORA-32034: unsupported use of WITH clause:
insert into tq84_t
with function f(i number) return number as begin
return i*2;
end f;
select
f(level)
from
dual connect by level <= 10;
/
The following statement uses the
with_plsql
hint to prevent this error:
insert /*+ with_plsql */ into tq84_t
with function f(i number) return number as begin
return i*2;
end f;
select
f(level)
from
dual connect by level <= 10;
/
Testing the result and cleaninug up:
select * from tq84_t;
drop table tq84_t;