Steve,

I am on SQL server, but the syntax is very helpful.

Thanks for responding,
Bill

-----Original Message-----
From: Steven Monaghan [mailto:[EMAIL PROTECTED]]
Sent: Friday, October 05, 2001 12:57 PM
To: SQL
Subject: RE: Update, Delete Trigger Help Needed?? Plz


Glad to help, but below is for Oracle.  No guarantees if you are on another
platform...

As a general note, I know that Oracle is in the minority and Access/MS SQL
Server are in the majority, but it would help if you stated the database in
any SQL type questions.

Now, what the trigger would look like:

CREATE OR REPLACE TRIGGER trigger_name
AFTER UPDATE OF column_name
ON table_name
DECLARE

BEGIN
        if :new.column_name = 'Whatever' then
                delete other_table
                where job_id = :new.job_id;
        end if;
END;
/

HTH,
Steve
-------------------------------------
Steven Monaghan
Oracle DBA / Cold Fusion Developer
MSC Industrial Direct Co., Inc.
Melville, NY
[EMAIL PROTECTED]
http://www.mscdirect.com
-------------------------------------
-----Original Message-----
From: Bill Killillay [mailto:[EMAIL PROTECTED]]
Sent: Friday, October 05, 2001 12:29 PM
To: SQL
Subject: Update, Delete Trigger Help Needed?? Plz


I am trying to create a trigger that checks one table every time it's
updated for a value in one of the fields, if that value is a one, it then
needs to delete an entry in another table where both tables job_id matches.

Does anybody have an idea what this might look like?  It's been a long week
and my eyes, and brain are fried... any help would be greatly appreciated.

Thanks,
Bill K.



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to