I have written 4 sql queries.2 select commands and 2 delete commands.now I want to write a pl/sql block for this.i.e after 2 select statements if the given condition satisfies then 1st delete command applicable. same way for 2nd delete command.I want to write cusor for those 2 select statements.
the queries are a sfollows
from cost_sup_detail cpd1
where cpd1.cost_change in (select cph.cost_change
from item_country isc,
cph.active_date=(select bdate from units) and cph.cost_change = cpd.cost_change
and cpd.item = isc.item
and cpd.supplier = isc.supplier
and cpd.origin_country_id = isc.origin_country_id
and cpd.unit_cost = isc.unit_cost)
same way for 2 nd query.. now the condition is
if active_date=bdate+5 then
1st delete command... applicable..
for this I need to write PL/SQL program either procedure or function what ever it may be...
please write the pl/sql block for this.....
Free Guide: Managing storage for virtual environments
Complete a brief survey to get a complimentary 70-page whitepaper featuring the best methods and solutions for your virtual environment, as well as hypervisor-specific management advice from TechTarget experts. Don’t miss out on this exclusive content!