This forum is currently locked. You can't register or post questions at this time. (read more)

error in trigger

All posts relating to Oracle PL/SQL development.

Moderator: Tim...

Mdjahangirpasha
Member
Posts: 22
Joined: Sun Dec 15, 2013 8:31 am

error in trigger

Postby Mdjahangirpasha » Tue Dec 24, 2013 6:54 am

Hi
Tim...
I've created one package with a name pack_bal in which I've created procedure upd_bal to update balance and 3-functions with their functionality mention below
1) chk_bal :- it check the balance and returns boolean
2) fnow:- it check for no. of withdrawl returns number
3) ftwa:- check total withdrawl amount returns number

and created one trigger named trg_bal to update,check balance in kcb_tran_tab and kcb_acc_tab table whose code is given below

Code: Select all

create or replace trigger trg_bal
before insert
on kcb_tran_tab
for each row
begin
    if :new.ttype = 'D' then
        pack_bal.upd_bal(:new.accno,:new.ttype,:new.amount);
    elsif :new.ttype = 'W' then
        if pack_bal.chk_bal(:new.accno,:new.amount) and
           pack_bal.fnow(:new.accno)<3 and
           pack_bal.ftwa(:new.accno)<30000 THEN
           
           pack_bal.upd_bal(:new.accno,:new.ttype,:new.amount);
           
        else
           raise_application_error(-20345,'MAY BALANCE IS TOO LOW (OR)
                                           NO. OF WITHDRAWL EXCEED''S (OR)
                                           WITHDRAWL AMOUNT EXCEED''S LIMIT');
   
    END IF;
    exception
    WHEN NO_DATA_FOUND then
    raise_application_error(-20456,:new.accno||'account no doesnot exists');
end trg_bal;


It's giving me an error I've gone through this many time but didn't catch error could you please do it for me.


Thanks a lot

Tim...
Site Admin
Posts: 18437
Joined: Mon Nov 01, 2004 5:56 pm
Location: England, UK
Contact:

Re: error in trigger

Postby Tim... » Tue Dec 24, 2013 10:53 am

Hi.

What is the error it is giving you? My telepathy is a little off today. :)

Cheers

Tim...
Tim...
Oracle ACE Director
Oracle ACE of the Year 2006 - Oracle Magazine Editors Choice Awards
OakTable Member
OCP DBA 7.3, 8, 8i, 9i, 10g, 11g
OCP Advanced PL/SQL Developer
Oracle Database: SQL Certified Expert
My website: http://www.oracle-base.com
My blog: http://www.oracle-base.com/blog


Return to “Oracle SQL and PL/SQL Development”

Who is online

Users browsing this forum: No registered users and 5 guests

cron