Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Oracle NULL vs '' revisited

Re: Oracle NULL vs '' revisited

From: DA Morgan <damorgan_at_psoug.org>
Date: Wed, 22 Aug 2007 09:04:12 -0700
Message-ID: <1187798650.227223@bubbleator.drizzle.com>


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.

SQL>

-- 
Daniel A. Morgan
University of Washington
damorgan_at_x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org
Received on Wed Aug 22 2007 - 11:04:12 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US