Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Database trigger on AFTER UPDATE with Procedure Bldr.
I'm trying to use Procedure Builder to create an AFTER UPDATE database
trigger which replaces a column value with a value contained in another
table. Let's say I'm building the trigger on Table1 on a column called
entry_id. The trigger checks another column in Table1 called Descrip1. When
Descrip1 is null, I want to UPDATE the Descrip1 with a value from Table2.
Table 1 and Table 2 are joined by entry_id, which is the primary key for
Table1. I'm using Procedure Builder, so I've got Table1 and entry_id
selected, with a WHEN NEW.DESCRIP1 IS NULL condition specified. The trigger
body looks like this, but returns an error of too many rows selected DECLARE
descr VARCHAR(2); BEGIN select descrip2 into descr from TABLE2; INSERT into
Table1(descrip1) values(descr); END;
-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Fri Dec 25 1998 - 08:48:59 CST