create or replace procedure postxns as
acno number:=&acno;
pamt number:=&pamt;
cou number;
cid varchar2(16);
bal number;
cdno varchar2(16);
pdt date:=&pdt;
bal1 number;
txnno number;
begin
select count(*) into cou from customer_master where accno=acno;
select cin,balance into cid,bal from customer_master where accno=acno;
select cardno into cdno from card_master where cin=cid;
bal1:=bal;
if(cou>0) then
if bal>pamt then
select to_char(pdt,'ddmmyyyyhhmiss')||transeq.nextval into txnno from dual;
bal1:=bal1-pamt;
dbms_output.put_line('bal1:'||bal1||cdno||pdt||pamt||txnno);
insert into daily_transactions values(cdno,pdt,bal1,0,pamt,txnno);
update customer_master set balance=bal-pamt where cin=cid;
commit;
--update daily_transactions set pos=tamt where cardnoo=cdno;
dbms_output.put_line('Account Balance Updated');
else
dbms_output.put_line('Insufficient Funds');
end if;
else
dbms_output.put_line('Account Number Does Not Exist');
end if;
end;
/
Subscribe to:
Post Comments (Atom)
MY HIT COUNTER
Blog Archive
-
▼
2009
(38)
-
▼
November
(27)
- few programs on bank project
- customer identification number
- bank programs
- min balance program in oracle
- cards balance
- real time programs in bank project
- real time registration example
- Creation of tables in oracle
- practice quries
- quries
- reverse number
- throws exception
- throws exception
- divide by zero
- array index
- length of a string name
- no parameters to string
- print two parameters
- abstract class in core java
- inside area of rectangle
- area of rectangle
- three string parameters
- class b extends a
- incremeting numbers
- sum of three parameters
- box program
- strings
-
▼
November
(27)
Custom Search
No comments:
Post a Comment