oracle set linesize 100,set linesize isn't working in sqlplus

I'm trying to use sqlplus to dump out some DDL for a stored procedure. I have found an issue with my script where it doesn't properly dump out the lines into a file, and this appears to be caused by problems with the "set linesize" command in sqlplus. Lines are getting truncated at 80 characters no matter what I set the linesize variable to (currently I changed it to 500 as a test -- but it still doesn't work)!

For example, suppose I have a line in the procedure like this:

CREATE OR REPLACE PROCEDURE

...

INSERT INTO SOME_TABLE_NAME_HERE (OWNER, ACTIVITY, ACTIVITY_COST, NUM_WORKERS, NULL)

SELECT ...

I can see in SQL Developer that the 80th character is the N in "NULL" and that "ULL" are beyond the limit. When I dump out the DDL in sqlplus, it's showing up like this, no matter what I set linesize to:

CREATE OR REPLACE PROCEDURE

...

INSERT INTO SOME_TABLE_NAME_HERE (OWNER, ACTIVITY, ACTIVITY_COST, NUM_WORKERS, N

ULL)

SELECT ...

Here are the options that I am using in their entirety. This is an excerpt from a shell script that I am working on, but you can see the options that get echoed into the file that is ultimately read/executed by sqlplus:

echo "set heading off;" >> proc.sql

echo "set echo off;" >> proc.sql

echo "set pages 999;" >> proc.sql

echo "set termout off;" >> proc.sql

echo "set long 90000;" >> proc.sql

echo "set linesize 200;" >> proc.sql

echo "spool ${schema}.txt" >> proc.sql

echo "select dbms_metadata.get_ddl('PROCEDURE', '${proc}') from dual;" >> proc.sql

No matter what I set linesize to it always truncates at the 80th character and starts printing on the next line. Changing the linesize option only seems to pad the right side of the output with spaces. So if the line is longer than 80 characters and I set linesize to 90, it will truncate at the 80th character, print 10 spaces, and then print "ULL)" and 86 spaces on the next line. If I change it to 100 then I get 20 spaces on the first line, followed by "ULL)" and 96 spaces on the next line. And so on...

I tried using trimspool ON but that doesn't help the issue. Setting linesize appears to be pointless -- everything is truncated at 80 characters. What am I doing wrong here? Thanks!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值