【问题标题】:Format Describe In SQL*PlusSQL*Plus 中的格式描述
【发布时间】:2011-01-10 14:02:22
【问题描述】:

我喜欢 SQLPlus 中的大行大小,这样数据就不会在行之间换行。问题是对对象进行描述似乎有义务将其自身扩展到整个行大小。这使得我只能看到名称部分而无需向右滚动。我想要的是一个用于描述的线条大小和一个用于其他所有内容的不同线条大小。要了解我的意思,请在 SQL 中运行以下命令Plus:

set linesize 100;
describe all_tab_columns; --Desired Output
select * from all_tab_columns where rownum<=1;

然后使用大线号。

set linesize 3000;
describe all_tab_columns;
select * from all_tab_columns where rownum<=1; --Desired Output

我所问的可能是不可能的,所以我也对部分解决方案感兴趣。不断改变线条大小不是解决办法。

【问题讨论】:

    标签: oracle sqlplus oracle11g


    【解决方案1】:

    是什么阻止你设置 linesize?

    set linesize 100; 
    describe all_tab_columns;
    set linesize 3000; 
    select * from all_tab_columns where rownum<=1;
    

    如果您经常这样做,请编写 SQL 脚本以使其更方便。

    【讨论】:

    • 我创建了一个可以使用 '@desc ' 调用的脚本,如下所示:
    • 设置 linesize 100;描述 &1;设置 linesize 3000;
    【解决方案2】:

    我有我自己的 DESC 版本作为一个包,所以我这样做了 exec DESCR('table_name');

    代码可用Here

    【讨论】:

    • +1 我想过这样做,但希望有一个更简单的解决方案。从好的方面来说,我可以在描述中提供更多信息。
    猜你喜欢
    • 2019-01-09
    • 2015-12-10
    • 2011-08-11
    • 2022-10-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多