|
-
CREATE OR REPLACE TRIGGER credit_trig_iu
AFTER insert or update ON CREDIT_LIMIT_HISTORY
for each row
BEGIN
IF (:new.type = 'FINANCE') THEN
INSERT INTO credit_interface(finance_credit_limit) VALUES(:new.credit_limit);
ELSIF (:new.type = 'CASH') THEN
INSERT INTO credit_interface(cash_credit_limit) VALUES(:new.credit_limit);
ELSIF (:new.type = 'SUBSIDY') THEN
INSERT INTO credit_interface(subsidy_credit_limit) VALUES(:new.credit_limit);
ELSE
-- error in type variable
-- for example : raise_application_error(...);
null;
END IF;
-- had better add exception block
--
--EXCEPTION when ...
END;
/
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|