在终端中显示时如何格式化sqlplus中的列? [英] How to format the columns in sqlplus while displaying it in the terminal?

查看:53
本文介绍了在终端中显示时如何格式化sqlplus中的列?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Ubuntu 上的 Oracle DB XE 中使用 HR 帐户.所以我在终端中运行 SQL*Plus.我知道最大可显示线宽是 150 而不换行但是当我在终端中显示员工表时,最后两列最终会环绕.我有

I was using the HR account in the Oracle DB XE on Ubuntu. So I am running the SQL*Plus in the terminal. I know that the maximum displayable linesize is 150 without wrapping but when I display the employee table in the terminal the last two columns end up wrapping around. I have

set lines 150;
set trimout on;
set pagesize 10000;
set tab off;
set wrap on;

我看到

正如您在此处看到的,LAST_NAME、EMAIL、HIRE_DATE 列占用了额外的空格,这些空格可用于显示被换行的列.我试着打开和关闭包装,但这也无济于事.我如何优化消耗的空间,因为我也在假脱机文件并且输出看起来非常混乱.

as you can see here the columns LAST_NAME, EMAIL, HIRE_DATE are taking extra blank spaces which could be other wise utilized for displaying the columns which get wrapped. I tried flicking the wrap on and off and that doesn’t help either. How can I optimize the space consumed as I am also spooling the file and the output is very confusing to look at.

推荐答案

尝试添加

COLUMN LAST_NAME FORMAT A10 

/

限制为 10 个 alfanum 字符

for limit to 10 alfanum char

这篇关于在终端中显示时如何格式化sqlplus中的列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆