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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: AFTER CREATE trigger help, please

RE: AFTER CREATE trigger help, please

From: Grabowy, Chris <cgrabowy_at_fcg.com>
Date: Fri, 10 May 2002 11:28:26 -0800
Message-ID: <F001.0045E890.20020510112826@fatcity.com>


Actually...

SQL> create or replace trigger test
  2 after insert on test_table
  3 begin
  4 dbms_output.put_line ('Hello from trigger!!!');   5 end;
  6 /

Trigger created.

Elapsed: 00:00:00.02
SQL> insert into test_table values ('Hello'); Hello from trigger!!!

1 row created.

Elapsed: 00:00:00.06

Execution Plan


   0 INSERT STATEMENT Optimizer=CHOOSE

Statistics


          3  recursive calls
          5  db block gets
          7  consistent gets
          0  physical reads
        372  redo size
        550  bytes sent via SQL*Net to client
        627  bytes received via SQL*Net from client
          4  SQL*Net roundtrips to/from client
          2  sorts (memory)
          0  sorts (disk)
          1  rows processed

SQL> Bill, I would simplify the trigger, and then work out from there.

Chris

-----Original Message-----
Sent: Friday, May 10, 2002 2:23 PM
To: Multiple recipients of list ORACLE-L

Bill,

A trigger cannot display output.

Where would it go? A trigger does not run in an interactive session, it runs in the database independently, regardless of the presence or absence of a SQL Plus session.

Jared

"Magaliff, Bill" <Bill.Magaliff_at_lendware.com> Sent by: root_at_fatcity.com
05/10/2002 09:08 AM
Please respond to ORACLE-L  

        To:     Multiple recipients of list ORACLE-L <ORACLE-L_at_fatcity.com>
        cc: 
        Subject:        AFTER CREATE trigger help, please


I'm creating an AFTER CREATE ddl trigger:

CREATE OR REPLACE TRIGGER after_create_trg   after create
   on lwdev.schema
begin

   if sys.dictionary_obj_type='TABLE'

                 OR sys.dictionary_obj_type='SEQUENCE'
    then
                 begin
                                  dbms_output.put_line ('TEST');
                                  dbms_output.put_line 

(sys.dictionary_obj_name || ' , ' ||

sys.dictionary_obj_type);
                 exception
                                 when others then 
                                                 dbms_output.put_line 

('ERROR');
                 end;

   end if;

end;
/

Trigger created as user LWDEV

I have serverout set to ON, but I get nothing when creating a new table . .
.

any ideas, please??

thanks, all

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Magaliff, Bill
  INET: Bill.Magaliff_at_lendware.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L

(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: INET: Jared.Still_at_radisys.com Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Grabowy, Chris INET: cgrabowy_at_fcg.com Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).
Received on Fri May 10 2002 - 14:28:26 CDT

Original text of this message

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