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

Home -> Community -> Usenet -> c.d.o.misc -> Re: spooling TRIGGER_BODY

Re: spooling TRIGGER_BODY

From: Andy Hassall <andy_at_andyh.co.uk>
Date: Wed, 19 Jan 2005 00:07:59 +0000
Message-ID: <r18ru0p6ojuh1s5t9cvkdvjmjc5roscnto@4ax.com>


On Tue, 18 Jan 2005 15:23:36 -0800, DA Morgan <damorgan_at_x.washington.edu> wrote:

>JR wrote:
>
>> When I try to spool a trigger body it wraps the characters past 80
>> characters to the next line. How can I prevent this from happening?
>> The set line command doesn't seem to help.
>>
>> See how the create_date statement is chopped in the example below :
>>
>> sqlplus> set line 200
>Where did you find your sytax for SQL*Plus?
>
>SQL> set linesize 200

"set line 200" and "set linesize 200" are equivalent and both valid. As are:

SQL> set lin 20
SQL> show linesize
linesize 20
SQL> set line 30
SQL> show linesize
linesize 30
SQL> set lines 40
SQL> show linesize
linesize 40
SQL> set linesi 50
SQL> show linesize
linesize 50
SQL> set linesiz 60
SQL> show linesize
linesize 60
SQL> set linesize 70
SQL> show linesize
linesize 70

http://download-uk.oracle.com/docs/cd/B10501_01/server.920/a90842/ch13.htm#1012664 "SET LIN[ESIZE] {80|n}"

 For the SQL*Plus SET commands, you can abbreviate off any part of the bit in square brackets.

 To the OP: if you want a longer line for trigger body, one approach is to use the "column" command, e.g.: (and most likely the long line here will wrap in the post... but it's not wrapped in SQL*Plus)

SQL> set long 10000
SQL> set line 200
SQL> select trigger_body from user_triggers where trigger_name = 'T_TEST';

TRIGGER_BODY



begin

    null;--
testinglonglinetestinglonglinetestinglonglinetestinglonglinetestingl onglinetestinglongline
end;

SQL> column trigger_body format a256
SQL> / TRIGGER_BODY



begin

    null;--
testinglonglinetestinglonglinetestinglonglinetestinglonglinetestinglonglinetestinglongline end;

 Also from the SQL*Plus manual:

"A LONG, CLOB, NCLOB or XMLType column's width defaults to the value of SET LONGCHUNKSIZE or SET LONG, whichever one is smaller."

 LONGCHUNKSIZE defaults to 80, hence the 80 character column. After exiting and restarting SQL*Plus to clear the previous settings:

SQL> set long 10000
SQL> set longchunksize 10000
SQL> set line 200
SQL> select trigger_body from user_triggers where trigger_name = 'T_TEST';

TRIGGER_BODY



begin

    null;--
testinglonglinetestinglonglinetestinglonglinetestinglonglinetestinglonglinetestinglongline end;

-- 
Andy Hassall / <andy@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Received on Tue Jan 18 2005 - 18:07:59 CST

Original text of this message

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