Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Database trigger on AFTER UPDATE with Procedure Bldr.
Sounds like your query to the second table is bringing back more than one
row of data - your code excerpt doesn't seem to include a where clause.
Also, if you are just trying to replace a column value as the row is inserted/updated you should be doing something like ':new.col1 := my_replacement_value' - you seem to be trying to insert a new row into table1??
Andy
bdickey_at_my-dejanews.com wrote in article
<7608kr$lt9$1_at_nnrp1.dejanews.com>...
> 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 Sat Dec 26 1998 - 07:36:54 CST
![]() |
![]() |