Home » SQL & PL/SQL » SQL & PL/SQL » Triggers - A Basic Question
Triggers - A Basic Question [message #6802] Tue, 06 May 2003 14:10 Go to next message
Sankar B. Mandalika
Messages: 20
Registered: November 2002
Junior Member
Hi,

I need to come up with a trigger that accomplishes the following:

1. I have a table named CREDIT_CARDS. It has a field named APPROVAL_STATUS.
2. Each time the APPROVAL_STATUS changes to approved (it can also be set to rejected), the name and ss# fields should be inserted into another table named APPROVAL_LIST.
3. However, before the insertion, the name and ss# should be matched against values in the APPLICANT_LIST table. What would be the easiest way to code this? I have coded a few versions but they are not quite working. Any suggestions/pointers/examples would be greatly appreciated.

Many thanks,
Sankar.
Re: Triggers - A Basic Question [message #6803 is a reply to message #6802] Tue, 06 May 2003 17:44 Go to previous messageGo to next message
Sankar B. Mandalika
Messages: 20
Registered: November 2002
Junior Member
Here is the basic structure I came up with:

CREATE OR REPLACE TRIGGER CATrigger

AFTER UPDATE OF approval_status ON credit_cards

FOR EACH ROW

WHEN (new.approval_status = "Approved")


BEGIN

INSERT INTO APPROVAL_LIST VALUES(:new.name, :new.ssid);
END;

What I need to know how I can bring the other table (approval_list) into the picture to make the comparison
Re: Triggers - A Basic Question [message #6805 is a reply to message #6803] Tue, 06 May 2003 17:59 Go to previous message
Todd Barry
Messages: 4819
Registered: August 2001
Senior Member
See response in PL/SQL forum.
Previous Topic: create a new sequence which should start with a value base on a column value
Next Topic: oracle forms6i running based on application server.
Goto Forum:
  


Current Time: Fri Apr 19 00:33:01 CDT 2024