1600 PMP mock questions 1400 CAPM mock questions 800 SCJP 6 mock questions 600 OCAJP 7 mock questions 590 OCPJP 7 mock questions 556 SCWCD 5 mock questions 500 OCEJWCD 6 mock questions pdfDownload (java,struts, hibernet etc)

ORACLE Tutorials

MASTER TABLE - 'INVENTORY' AND TRANSACTION TABLE - 'INVNT_TRANS'
UPDATION DEPENDING ON THE ORDER PLACED BY THE CUSTOMER



DECLARE
    ipname inventory.prod_name%type := '&ipname'; --name of prod ordered
    pid inventory.prod_id%type;
    ipqty inventory.stk_qty%type := &ipqty; -- qty of prod ordered
    cpqty inventory.stk_qty%type; -- qty or stock of prod available

    cursor c1 is select stk_qty from inventory where
    prod_name = ipname;
BEGIN
open c1;
loop
fetch c1 into cpqty;
exit when c1%notfound;
if cpqty >= ipqty then
update inventory set stk_qty=cpqty - ipqty
where prod_name = ipname;
insert into invnt_trans values(sysdate,ipname,cpqty,ipqty);
dbms_output.put_line(ipname||' order complete');
else
dbms_output.put_line(ipname||' no stock....');
end if;
end loop;
close c1;
END;

Reviews and Comments


PMP, CAPM, PMI is a registered certification mark of the Project Management Institute, Inc

Copyright © www.techfaq360.com 2016


About US | Contact US | Privacy Policy | Terms and Conditions  | Website disclaimer  | Cancellation and Refund Policy  | Shipping & Delivery Policy