Oracle PL/SQL Trigger Needed

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

CraigCKlein

Thread Starter
Joined
May 28, 2004
Messages
20
Database contains.

Table a:
Columns OBJECT_KEY, INVOICE_DATE, DATE_APPROVED

Table b: child table of table a
Columns OBJECT_KEY, A_KEY (points back to table a), AMOUNT

Here is what I need to do.

I need to prevent users from updating table b when table a is approved. I was thinking of the following in my Before Update Trigger on table b:

Declare
tApproved DATE;
begin
SELECT a.DATE_APPROVED
INTO tApproved
FROM gex.A
WHERE a.OBJECT_KEY = :new.a_key;
IF NOT tApproved IS NULL THEN
rollback;
END IF;
end;

but this does not work.
Thanks
Craig
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Top