Triggers - A Basic Question [message #6802] |
Tue, 06 May 2003 14:10 |
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 |
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
|
|
|
|