Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

I am trying to write PL/SQL CODE FOR ATM Machine

789305Aug 16 2010 — edited Aug 17 2010
I am trying to write PL/SQL CODE FOR ATM Machine


declare
vaccno kcb_acc.accno%type:=&accno;
vamt kcb_trans.amt%type:=&amount;
vbal kcb_acc.bal%type;
vatype kcb_acc.atype%type;
begin
select atype,bal into vatype,vbal from kcb_acc where accno=vaccno;
vbal:=vbal-vamt;
if (vatype ='S' and vbal<5000) or (vatype='C' and vbal<10000) then
raise_application_error(-20345,'insufficient funds');
else
update kcb_acc set bal=vbal where accno=vaccno;
insert into kcb_trans values (s1.nextval,vaccno,vatype,sysdate,vamt);
end if;
end;

something like pls helpme

Edited by: nataraj kesana on Aug 16, 2010 10:06 PM

Comments

Processing
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Sep 13 2010
Added on Aug 16 2010
8 comments
2,178 views