Hi
I try to insert an bulk collection and use thw when clause:
create table ort_rest as select * from dept where 1=2;
create table ort_10 as select * from dept where 1=2;
declare
type ort_rec is table of dept%rowtype index by pls_integer;
ort_tab ort_rec;
begin
select * bulk collect into ort_tab from dept;
forall i in ort_tab.first .. ort_tab.last
insert
WHEN ort_tab(i).deptno = 10 THEN
INTO ort_10
VALUES (
ort_tab(i).deptno,
ort_tab(i).dname,
ort_tab(i).loc
)
ELSE
INTO ort_rest
VALUES (
ort_tab(i).deptno,
ort_tab(i).dname,
ort_tab(i).loc
)
select deptno,dname,loc from table(ort_tab);
commit;
end;
I get the error
Fehlerbericht -
ORA-06550: Zeile 22, Spalte 40:
PLS-00382: Dieser Ausdruck hat den falschen Typ
ORA-06550: Zeile 22, Spalte 34:
PL/SQL: ORA-22905: Zugriff auf Zeilen eines Objekts, das keine Nested Table ist, nicht möglich
ORA-06550: Zeile 7, Spalte 1:
PL/SQL: SQL Statement ignored
06550. 00000 - "line %s, column %s:\n%s"
*Cause: Usually a PL/SQL compilation error.
Please help me
Regards
Siegwin