oracle 如何在 PL/SQL 开发人员的网格输出中设置 numwidth?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4063167/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to set numwidth in the grid output of PL/SQL developer?
提问by Ilya Kogan
I'm running some queries in PL/SQL Developer, and one of the columns in the result has 18-digit numbers. Instead of displaying the entire number in the resulting grid, PL/SQL Developer displays only 15 digits in scientific notation.
我正在 PL/SQL Developer 中运行一些查询,结果中的一列有 18 位数字。PL/SQL Developer 没有在结果网格中显示整个数字,而是仅以科学记数法显示 15 位数字。
I tried to find a way to change this in the preferences of the program, so that I'll see the entire number, just like set numwidth
does in SQL*Plus. But my search was futile.
我试图在程序的首选项中找到一种方法来更改它,以便我可以看到整个数字,就像set numwidth
在 SQL*Plus 中一样。但我的搜索是徒劳的。
How do I change this setting?
如何更改此设置?
回答by Ilya Kogan
Turns out this ispossible!!!
原来这是可能的!!!
Tools -> Preferences -> SQL Window -> Number fields to_char
工具 -> 首选项 -> SQL 窗口 -> 数字字段 to_char
回答by RiKl
Use to_char, then you get the all the numbers:
使用 to_char,然后你得到所有的数字:
select to_char ( t.reference_nr), t.reference_nr from rss_ing_cc_imp t
1 95209140353000001009592 9,5209140353E22
2 25546980354901372045601 2,55469803549014E22
3 75203220356000583867347 7,52032203560006E22
4 25546980357904327000017 2,55469803579043E22
5 95209140358000000700337 9,5209140358E22
6 95209140359000000596387 9,5209140359E22
7 25546980361131086003511 2,55469803611311E22
8 25546980361901390031808 2,55469803619014E22
9 85207130362051881964326 8,52071303620519E22
10 95209140363000000634885 9,5209140363E22
11 25546980364131099000436 2,55469803641311E22
12 95209141001000001006196 9,5209141001E22
13 85207131001100892094030 8,52071310011009E22
14 75203221001000590476576 7,52032210010006E22
回答by Anders
You can also set the column format(Using the same table name as above...)
您还可以设置列格式(使用与上面相同的表名...)
column reference_nr format 99999999999999999999999999999999
列 reference_nr 格式 99999999999999999999999999999999
Select reference_nr from rss_ing_cc_imp;
从 rss_ing_cc_imp 中选择 reference_nr;
REFERENCE_NR
REFERENCE_NR
95209140353000001009592
25546980354901372045601
Or ( new session ) which probably is better:
或者(新会话)可能更好:
show numwidth
显示宽度
numwidth 10
数字宽度 10
Select reference_nr from rss_ing_cc_imp;
从 rss_ing_cc_imp 中选择 reference_nr;
REFERENCE_NR
REFERENCE_NR
9.5E+22
2.6E+22
Set numwidth 30
设置 numwidth 30
show numwidth
显示宽度
numwidth 30
数字宽度 30
Select reference_nr from rss_ing_cc_imp;
从 rss_ing_cc_imp 中选择 reference_nr;
REFERENCE_NR
REFERENCE_NR
95209140353000001009592
25546980354901372045601
回答by Garvit Jain
SET sqlformat ansiconsole;
This will set the output format for any queries that you run hereafter. There are other sql formats but this is probably the best for your situation.
这将为您以后运行的任何查询设置输出格式。还有其他 sql 格式,但这可能最适合您的情况。
To revert to what you had earlier, use.
要恢复到之前的状态,请使用。
UNSET sqlformat;
*This has been verified on SQLDeveloper Version 18.3.0.277, Build 277.2354
*这已在 SQLDeveloper 版本 18.3.0.277, Build 277.2354 上得到验证
回答by mojo-jojo
Same answer as Ilya Kogan, but in PL SQL Dev 13 the Preferences has moved and is now under an little tuner icon in the title bar. Then SQL Window -> Number fields to_char
与 Ilya Kogan 的答案相同,但在 PL SQL Dev 13 中,首选项已移动,现在位于标题栏中的一个小调谐器图标下。然后 SQL Window -> Number fields to_char