RE: Looking for null byte (0x0) characters in triggers

  • From: "Yong Huang" <dmarc-noreply@xxxxxxxxxxxxx> (Redacted sender "yong321" for DMARC)
  • To: <oracle-l@xxxxxxxxxxxxx>
  • Date: Fri, 6 May 2016 20:57:21 +0000 (UTC)

I think the trigger code always shows up in dba_source. I just found a 10g 
database and tested:

SQL> create trigger test_trig
  2   after update on t
  3  begin
  4   null;
  5  end;
  6  /

Trigger created.

SQL> select * from user_source where name = 'TEST_TRIG';

NAME                           TYPE               LINE
------------------------------ ------------ ----------
TEXT
--------------------------------------------------------
TEST_TRIG                      TRIGGER               1
trigger test_trig

TEST_TRIG                      TRIGGER               2
 after update on t

TEST_TRIG                      TRIGGER               3
begin

TEST_TRIG                      TRIGGER               4
 null;

TEST_TRIG                      TRIGGER               5
end;

SQL> select * from v$version where rownum=1;

BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi

Can you show me a case where the trigger code is not in dba_source? I tried an 
uncompilable trigger and it's still in dba_source:

SQL> drop trigger test_trig;

Trigger dropped.

SQL> create trigger test_trig
  2   after update on t
  3  begin
  4   garbage;
  5  end;
  6  /

Warning: Trigger created with compilation errors.

SQL> select text from user_source where name = 'TEST_TRIG';

TEXT
-----------------------------------------------------------
trigger test_trig
 after update on t
begin
 garbage;
end;



----- original message -----

It appears to on the 10.2.0.5 system I checked.  When Oracle first added 
triggers to DBA_SOURCE only compiled triggers would show so you could see 
triggers in DBA_TRIGGERS that did not appear in DBA_SOURCE.  The ALTER TRIGGER 
COMPILE statement would not result in source showing up in DBA_SOURCE but if 
you dropped and the issued CREATE TRIGGER the trigger would appear.
--
//www.freelists.org/webpage/oracle-l


Other related posts: