Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to use IF condition in FORALL

660316Sep 24 2008 — edited Sep 25 2008
Hi,

I am using FORALL in a stored procedure to inser,update and delete DB records.
Is is possible to use it.

If yes, I want use IF condition in FORALL loop.

This is how I want to do it:

forall i in p_id.first..p_id.last
if condition then
Delete Data
else
Select count(*) int ncount from products where id=p(id);
if(ncount=0) then
Insert new record
else
Update exsisting record
end if;
end if;


Is it possible to achieve

Thanks in Advance
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 23 2008
Added on Sep 24 2008
22 comments
7,196 views