DA Morgan wrote:
> Serge Rielau wrote:
>
>> Will the trigger fire if no row is updated?
>>
>> Cheers
>> Serge
>
> Yes!
>
> Connected to:
> Oracle Database 11g Enterprise Edition Release 11.1.0.6.0
> With the Partitioning, OLAP and Data Mining options
>
> SQL> CREATE TABLE t (
> 2 testcol VARCHAR2(5));
>
> Table created.
>
> SQL> INSERT INTO t VALUES ('AAA');
>
> 1 row created.
>
> SQL> CREATE OR REPLACE TRIGGER testtrig
> 2 BEFORE UPDATE
> 3 ON t
> 4
> 5 DECLARE
> 6 vMsg VARCHAR2(30) := 'Trigger Fired';
> 7 BEGIN
> 8 dbms_output.put_line(vMsg);
> 9 END testtrig;
> 10 /
>
> Trigger created.
>
> SQL> set serveroutput on
> SQL> UPDATE t
> 2 SET testcol = 'BBB'
> 3 WHERE testcol = 'CCC';
> Trigger Fired <================ note that the trigger fired
>
> 0 rows updated.
Tx, I was misinformed then.
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Received on Wed Aug 22 2007 - 19:40:22 CDT