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 - 'ACC_MASTER' AND TRANSACITON TABLE - 'ACC_TRANS'
UPDATION ONLY FOR CUSTOMER'S WITHDRAWAL

DECLARE
    acno acc_master.acc_id%type := &acno;
    wthdrw acc_master.balance%type := &wthdrw;
    bal acc_master.balance%type;
    
    cursor c1 is select balance from acc_master
    where acc_id = acno;

    min_bal exception;
    lar_amt exception;

BEGIN
open c1;
loop
fetch c1 into bal;
exit when c1%notfound;
if bal = 1000 then
raise min_bal;
elsif bal - wthdrw <1000 then
raise lar_amt;
else -- if (bal - wthdrw >= 1000)
dbms_output.put_line('MASTER AND TRANS TABLES UPDATED!!!!!!');
update acc_master set
balance = bal - wthdrw where acc_id = acno;
insert into acc_trans values(acno,sysdate,wthdrw,0,bal-wthdrw);
end if;
end loop;
close c1;
EXCEPTION
when min_bal then
dbms_output.put_line('SORRY!!! BALANCE MINIMUM - CANNOT WITHDRAW...');
when lar_amt then
dbms_output.put_line('MINIMUM BALANCE NOT BEING MAINTAINED !!!');
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