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: Are Triggers Really that Bad or ....???

Re: Are Triggers Really that Bad or ....???

From: Ronnie Yours <ronnie_yours_at_yahoo.com>
Date: Wed, 14 Aug 2002 16:16:57 -0400
Message-ID: <ajee01$6bd$1@nntp-m01.news.aol.com>


Hi,

I tried playing around with the idea of reducing the amount of work needed to automate the process of creating triggers for all the tables and this is what i came up with

select 'Create or replace Trigger '||table_name||'_Trigger BEFORE INSERT OR UPDATE ON '||
table_name||' for each row BEGIN IF inserting THEN :NEW.created_date:=sysdate; :NEW.created_by:=user; END IF; If Updating then :NEW.updated_date:=sysdate; :NEW.updated_by:=user; end if; END; /' from dba_tab_columns where column_name='CREATED_DATE'

I spool the above query into a file and execute it.

It would work fine , but the only problem is the / at the end of the procedure it creates. The / should appear on the next line and I am not able to do so. Is there a way I can force a carriage return before the /.

If i manually edit the output of the above query so that the / appears on the next line of each result set, it works great.

Please suggest

Thanks
Ronnie Received on Wed Aug 14 2002 - 15:16:57 CDT

Original text of this message

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