为什么我在格式化之后的 NUMBER 列中得到 ####... Oracle?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17284092/
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
Why do i get #### in the NUMBER column after format... Oracle?
提问by CHEBURASHKA
I have two problematic columns: Fee
NUMBER type, AdjFee
also NUMBER.
After
我有两个有问题的列:Fee
NUMBER 类型,AdjFee
还有 NUMBER。后
column Fee format a5;
select Fee ID smth
from Visit;
i get
我明白了
Fee ID smth
#### 123 klkl
#### 654 rfjgr
采纳答案by Justin Cave
You can adjust the number of digits you want SQL*Plus to use to display the numeric data just as you adjust the number of characters used to display character data. Something like
您可以调整希望 SQL*Plus 用于显示数字数据的位数,就像调整用于显示字符数据的字符数一样。就像是
column fee format 999999999.99
will tell SQL*Plus to display up to 9 digits before the decimal point and two after the decimal point. You can adjust that, of course, if you know your fees are going to be smaller (or larger).
将告诉 SQL*Plus 显示小数点前最多 9 位和小数点后 2 位。当然,如果您知道您的费用会减少(或增加),您可以调整它。
回答by Anonymous
Yes, column names can be truncated (or) changed to the name you want
是的,列名可以被截断(或)更改为您想要的名称
From your above select statement.
从你上面的选择语句。
If you want to truncate 'Fee' column to 'Fe'. Here is the procedure -
如果要将“费用”列截断为“铁”。这是程序 -
col c1 heading "Fe" for a5
a5 的 col c1 标题为“Fe”
col c2 heading "ID" for 999
col c2 标题“ID”为 999
col c3 heading "smth" for a5
a5 的 col c3 标题“smth”
select fee c1, ID c2, smth c3 from visit;
从访问中选择费用 c1、ID c2、smth c3;