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!

Insert only if the table is empty

858164Nov 3 2011 — edited Nov 3 2011
hi all

i am searching on the net and would like to check/confirm if it is possible to do insert based on the condition if the table is empty else do update
i am doing bulk insert in the table but only want to do it if the table is empty
else i wanna do update

in the bulk insert

the code is as follow :
    forall x in 1..tableabc.count
         insert into table_name values tableabc(x);
     exit when tbaleabc%notfound;
        end loop
can you please let me know where i can put the condition ** an example would be very helpfull.



looking forward to all your suggestions/help
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 1 2011
Added on Nov 3 2011
8 comments
1,662 views