Re: triggers

From: <dmoyer_at_gpu.com>
Date: 1995/10/19
Message-ID: <465et6$m7k_at_nn2.fast.net>#1/1


In <46550l$gf2_at_crl12.crl.com>, mcgredo_at_crl.com (Donald R. McGregor) writes:
>
>OK, spot the error. I sure can't, and it's driving
>me nuts. (I'm a newbie with triggers under Oracle.)
>
>It's _supposed_ to update a couple data columns that
>duplicate data in another table. (don't ask.) The two tables are
>linked by custID. I can't get sqlplus to take it.
>
>create trigger pr_trig_1
>after update on pr_0_1
>for each row
>begin
>if updating then
>update pr_0_5
>set t1.custName = :new.custName, t1.custAddress = :new.custAddress
>from pr_0_5 t1, pr_0_1 t2
>where t1.custID = t2.custID;
>end if;
>end pr_trig_1;
>
>--
>Don McGregor | This post was freely adapted from _The Scarlet Letter_
>mcgredo_at_crl.com |

A from clause is not allowed in an update statement. Maybe you want to do a where custID = (select custID from pr_0_1 where ...)

scott moyer
dmoyer_at_gpu.com Received on Thu Oct 19 1995 - 00:00:00 CET

Original text of this message