Hi All
I really appreciate your advice regarding the below issue.
I have a big procedure so I cant put my procedure here but I will try to give you some details and might be I can convey my problem and get expert advice from you.
I have some values in PL/SQL collection named as TAB_ABC and then I filter this tab by using if statement and then add it to another tab TAB_ABC_REC and then insert it into my table. something like below.
Begin
For a in 1..TAB_ABC.COUNT
LOOP
IF TAB_ABC(a).group_no=100 then
TAB_ABC_REC.EXTEND(1);--Load values in this collection
TAB_ABC_REC(a).Name :=TAB_ABC(a).Name;
TAB_ABC_REC(a).Address :=TAB_ABC(a).Address;
END IF;
END LOOP;
BEGIN
FORALL j IN TAB_ABC_REC.FIRST..TAB_ABC_REC.LAST SAVE EXCEPTIONS
INSERT INTO ABC
(
NAME,
ADDRESS
)
VALUES
(
TAB_ABC_REC(j).Name,
TAB_ABC_REC(j).Address
);
Exception
---------------
-------------
------------
TAB_ABC_REC.DELETE;
END;
The above code is working fine but some time I received the following errors when I execute my package.
Subscript Beyond Count
error in array DML
As a result I got less records but the amazing thing is that some time this procedure runs well without any errors. Please guide how come I get rid of this error. Thanks
Regards
Shu