Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: DDL for triggers.
Maxim Demenko wrote:
> joel garry schrieb:
> > joel garry wrote:
> >> Maxim Demenko wrote:
> >>> joel garry schrieb:
> >>>
> >>> I don't have 9i actually to test, but i doubt, it would behave
> >>> differently. Here is for 10gR2
> >>>
> >>> SQL> select * from v$version
> >>> 2 /
> >>>
> >>> BANNER
> >>> --------------------------------------------------------------------------------
> >>> Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Prod
> >>> PL/SQL Release 10.2.0.2.0 - Production
> >>> CORE 10.2.0.2.0 Production
> >>> TNS for Linux: Version 10.2.0.2.0 - Production
> >>> NLSRTL Version 10.2.0.2.0 - Production
> >>>
> >>> SQL> set long 1000000 pages 0
> >>> SQL> select dbms_metadata.get_ddl('TRIGGER','FILES_TRG') from dual;
> >>>
> >> Thank you Maxim, that is indeed what I was missing.
> >>
> >> D'Oh!
> >>
> >
> > Actually, I D'Oh'd too soon. dbms_metadata actually is breaking up the
> > first variable after the BEGIN statement in the trigger.
> >
> > The first few characters are like this (as displayed in EM or
> > trigger_body in user_triggers):
> >
> > BEGIN :new.GL_BALANCE_00 :=
> >
> >>From dbms_metadata, it's coming out like this:
> >
> > BEFORE INSERT OR UPDATE ON <obscured for posting> FOR EACH ROW BEGIN
> > :ne
> > w.
> > GL_BALANCE_00 :=
> >
> > (If newsreaders are reformatting, there is a newline before
> > GL_BALANCE_00 and BEFORE through new. is on one line.)
> >
> > It's not linesize, as I can set linesize to 12000 or whatever, then
> > strip out pairs of blanks with sed and it still seems to be putting out
> > <80 character lines, breaking in the middle of whatever it is printing.
> > trimspool on doesn't help either. Something I'm still not
> > understanding about sql*plus, I guess. Or is there something I need
> > to be telling dbms_metadata? Or am I forced to utl_file.put?
> >
> > jg
>
Yeah, this is how I used to get stuff 10 years ago too :-) I was starting to do it this way when I got distracted by your previous post. Thanks for the Note.
> 2) select the clob with all default settings in sqlplus ( i.e. rename
> your login.sql) and only set long for appropriate size ( set long 10000)
> to see , whether it is one of your sqlplus settings which produces the
> newlines.
I generally don't have a login.sql, habit from the days when I would be on many customer systems per day. Scripts I develop tend to propagate explicit settings.
>
Outside of my requirements, though I was playing around with it to see if it was unix-specific. Results already forgotten, I think XE beta worked ok.
I'm off to the next alligator now, thanks again.
jg
-- @home.com is bogus. http://legal-solutions.hypermart.net/Doc10_files/image006.gifReceived on Fri Oct 27 2006 - 13:20:52 CDT