few programs on bank project

12.create or replace procedure atmtxns5064 as
cursor c1 is select * from daily_transactions5064 where withdraw <>0;
t daily_transactions5064%rowtype;
begin
open c1;
loop
fetch c1 into t;
exit when c1%notfound;
dbms_output.put_line('Card No: '||t.cardno ||'Tran Date: '||t.trandate|| 'Balance : '||t.balance||'Withdraw'||t.withdraw);
end loop;
dbms_output.put_line('');
close c1;
end;
/
13.create or replace procedure postrans5064 as
cursor c1 is select * from daily_transactions5064 where withdraw<>0;
t daily_transactions5064%rowtype;
begin
open c1;
dbms_output.put_line('');
loop
fetch c1 into t;
exit when c1%notfound;
dbms_output.put_line('Transaction Ref Number: '||t.txn_ref_no ||'Customer Number: '||t.cardno ||'Transaction Type: Pos Amount: '|| t.withdraw || 'Transaction Date: '||t.trandate);

end loop;
dbms_output.put_line('');
close c1;

end;
/

14.create or replace procedure moretxns5064 as
cursor c1 is select cardno,count(trandate) from daily_transactions5064 group by cardno having count(trandate)>=2;
--t daily_transactions5064%rowtype;
--t1 customer_master5064%rowtype;
cdno daily_transactions5064.cardno%type;
cou number;
begin
open c1;
dbms_output.put_line('');
loop
fetch c1 into cdno,cou;
exit when c1%notfound;
--dbms_output.put_line('Customer Identification Number: '||t.cin ||'Customer Number: '||t.accno ||'Customer Name: '||t.custname ||'Account Opening Date: '|| t.opdate || 'Opening Balance: '||t.opbal|| 'Balance : '||t.balance);
dbms_output.put_line('Card Number: '||cdno);
end loop;
dbms_output.put_line('');
close c1;

end;

No comments:

Post a Comment

Template Design by faris vio