Home » SQL & PL/SQL » SQL & PL/SQL » Problem with trigger
Problem with trigger [message #38712] Wed, 08 May 2002 01:15 Go to next message
Bipin sahani
Messages: 5
Registered: January 2001
Junior Member
Hi All,
Can u tell me what's problem with following trigger,It missed out some records .We have not able to find any problem with it .If possible anyone can help us out

Thankx and regards
Bipin
CREATE OR REPLACE TRIGGER ib600pt
AFTER INSERT
ON ib010mb
FOR EACH ROW
DECLARE

BEGIN

if :new.act_sector_cd = 'GF' then
INSERT INTO ib600mb(pfd_sector_cd,pfd_branch_cd,pfd_account_no,
pfd_account_type,pfd_account_ccy,pfd_description,
pfd_days_seq,pfd_maker,pfd_maker_date,
pfd_checker,pfd_checker_date)
VALUES(:new.act_sector_cd,:new.act_branch_cd,:new.act_account_no,
DECODE(:new.act_gl_no,
'100','CASH',
'103','CLG',
'104','OURA/C',
'108','GOILOC',
'109','SECLOC',
'110','LOAN','113','BILLSN',
'114','PICMIS',
'115','ADVULC',
'117','ADVCA',
'118','PDO',
'119','PDO',
'122','CLA',
'124','PREM',
'125','INSTAL',
'126','FURN',
'127','IENC',
'128','IENC',
'129','A/R',
'132','PPX',
'136','IPIA',
'140','CENC',
'150','SUSP',
'199','DEFF',
'251','SUNDRY',
'253','CASHCL',
'254','MNGCHK', '257','CURRAC',
'260','COD',
'262','CDT',
'263','IDB',
'265','BORR',
'267','BIRR',
'269','BIRR',
'270','OAAE',
'271','RFIT',
'272','AEHO',
'273','RFE',
'274','RFI',
'275','RFE',
'276','RFT',
'277','INTCO',
'278','RFCOMM',
'279','RFDI',
'280','IBR',
'281','DEFFCR','290','IG',
'300','INTPD',
'340','P/L',
'347','OCE',
'348','OCE',
'349','OOELOC',
'400','INTREC',
'401','INTREC',
'440','EXCH',
'460','COMM',
'461','COMM',
'500','SXB',
'501','FXB',
'502','FXOSP',
'504','IENC',
'505','SECWN',
'508','SECWN ',
'510','FWDPUR',
'513','LEASE','516','MARREV',
'517','MEMCON',
'520','OCU',
'530','SUSP',
'531','BROK',
'600','SXS',
'601','FXS',
'602','I/DSEC',
'603','COMSEC',
'604','CONREV',
'605','FXOBP',
'610','FWDSOL',
'614','IG',
'615','URPCON',
'620','CONT',
'660','TC',
'670','DRUBR',:new.act_account_type),
:new.act_curr_cd,:new.act_description,
1,:new.act_maker,:new.act_maker_date,
:new.act_checker,:new.act_checker_date);
elsif :new.act_sector_cd = 'GCB' then
INSERT INTO ib600mb(pfd_sector_cd,pfd_branch_cd,pfd_account_no,
pfd_account_type,pfd_account_ccy,pfd_description,
pfd_days_seq,pfd_maker,pfd_maker_date,
pfd_checker,pfd_checker_date)
VALUES(:new.act_sector_cd,:new.act_branch_cd,:new.act_account_no,
:new.act_account_type,
:new.act_curr_cd,:new.act_description,
1,:new.act_maker,:new.act_maker_date,
:new.act_checker,:new.act_checker_date);

end if;

EXCEPTION when no_data_found then null;

END;
/


Re: Problem with trigger [message #38715 is a reply to message #38712] Wed, 08 May 2002 04:38 Go to previous messageGo to next message
Rick Cale
Messages: 111
Registered: February 2002
Senior Member
Can you provide more detail of what the problem is?
Are some records of each type getting insert or from
just one type? If some records are getting inserted
I would think the if condition is suppressing the ones
you think should get inserted.
Re: Problem with trigger [message #38728 is a reply to message #38712] Wed, 08 May 2002 20:28 Go to previous message
Bipin sahani
Messages: 5
Registered: January 2001
Junior Member
No Rick,
There is only two distinct Sector Codes GF and GCB in table on which if condition is based.And morover it's part of primary key in both the tables.And it doesn't miss the record on consistent basis.Therefore we don't know how to go about it.And most of records of both types getting inserted and only few of some type are getting missed out

Thankx and regards
Bipin
Previous Topic: recordset Paging in Oracle
Next Topic: PRO*C Problem
Goto Forum:
  


Current Time: Fri Apr 26 07:05:16 CDT 2024