如何在SQLPLUS中向终端显示一行的列,其宽度为该列中数据的最大值
我想知道这是否可以在没有列格式的情况下完成。
当前示例:
TABLESPACE_NAME BIG DATAFILE_NAME ------------------------------ --- ------------------------------------------------------------------------------------------------------------------- STORETABS NO C:\ORACLE\APP\ASUH\ORADATA\TESTORCL\STORETABS_01.DBF STORETABS NO C:\ORACLE\APP\ASUH\ORADATA\TESTORCL\STORETABS_02.DBF
请注意,标题“-”行一直延伸到与定义的 varchar(n) 值相匹配。
是否有一个 SQLPLUS SET 命令可以自动将列宽调整为列标题的大小或列内最大数据的大小?
我希望它看起来像这样:
TABLESPACE_NAME BIG DATAFILE_NAME ---------------- --- ----------------------------------------------------- STORETABS NO C:\ORACLE\APP\ASUH\ORADATA\TESTORCL\STORETABS_01.DBF STORETABS NO C:\ORACLE\APP\ASUH\ORADATA\TESTORCL\STORETABS_02.DBF
如果不是通过列标题的大小,则更需要调整数据的最大大小。
I was wondering if this could be done without the COLUMN FORMAT.
Current example:
TABLESPACE_NAME BIG DATAFILE_NAME ------------------------------ --- ------------------------------------------------------------------------------------------------------------------- STORETABS NO C:\ORACLE\APP\ASUH\ORADATA\TESTORCL\STORETABS_01.DBF STORETABS NO C:\ORACLE\APP\ASUH\ORADATA\TESTORCL\STORETABS_02.DBF
Notice the header "-" lines are extended all the way out to match the varchar(n) value defined.
Is there a SQLPLUS SET command that will auto adjust the column width to either the size of the column header or the size of the max data within the column?
I want it to look like this:
TABLESPACE_NAME BIG DATAFILE_NAME ---------------- --- ----------------------------------------------------- STORETABS NO C:\ORACLE\APP\ASUH\ORADATA\TESTORCL\STORETABS_01.DBF STORETABS NO C:\ORACLE\APP\ASUH\ORADATA\TESTORCL\STORETABS_02.DBF
If not by the size of the column header, adjusting to the max size of the data is more desired.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不,没有这样的设置。
不可能有这样的设置,因为
SQL*Plus
一次获取arraysize(我认为默认值为 15)记录。因此,如果在 15 条记录之后获取另一个更长的记录,则--------....
已被打印/写入,SQL*Plus 没有机会对其进行调整。arraysize是通过
set arraysize n
设置的数字。No, there is no such setting.
There can't be such a setting, because
SQL*Plus
fetches arraysize (default of which is 15, I believe) records at a time. So, if after 15 records another longer record is fetched, the-------....
is already printed/written, leaving no chance to SQL*Plus to adjust it.arraysize is the number set with
set arraysize n
.