Oracle 修剪池仅尾随空白(不包括前导空白)
我想知道是否有任何技巧可以让 trimspool
仅修剪右侧的尾随空白。
我有使用 dbms_output.put_line 打印到控制台的代码,并且输出通常有缩进,以便更容易用眼睛扫描。我将线宽设置得相当大,以使某些输出更易于阅读,因此我还设置了 trimspool 以消除多余的空白。唯一的问题是现在前导空格以及尾随空格都被删除了。有办法解决这个问题吗?我可以在某些输出语句中添加前导(前导空格之前)“.
”字符,但我不允许修改大多数包中的代码。
以下是它在没有 trimmimg 的情况下输出的内容:
level 1 (EOL) level 2 (EOL) Some data (EOL)
这是当前在 trimspool
打开时输出的内容:
level 1(EOL) level 2(EOL) Some data(EOL)
这是我想要的:
level 1(EOL) level 2(EOL) Some data(EOL)
I am wondering if there's any tricks to get trimspool
to only trim trailing whitespace on the right.
I have code that uses dbms_output.put_line to print to the console, and the output often has indentation to make it easier to scan with the eyes. I set the line width rather large to make some of the output easier to read, so I also set trimspool to get rid of extra white space. The only problem is that now the leading which space is removed as well as the trailing whitespace. Is there a way to fix this? I could add a leading (before the leading whitespace) ".
" character to some of the output statements, but I'm not allowed to modify the code in most of the packages.
Here's what it outputs with no trimmimg:
level 1 (EOL) level 2 (EOL) Some data (EOL)
Here's what it currently outputs with trimspool
on:
level 1(EOL) level 2(EOL) Some data(EOL)
HEre's what I want:
level 1(EOL) level 2(EOL) Some data(EOL)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你就会追求
我想如果我确实理解你的问题,
。如果我这样做:
SQL*Plus 输出:
但是,如果我执行
SQL*Plus 输出:
您必须
设置 Trimspool on
以消除直至eol
的空格。I guess you're after
if I do understand your question.
If I do this:
SQL*Plus outputs:
If, however, I do
SQL*Plus outputs:
You have to
set trimspool on
in order to eliminate the spaces up toeol
.