如何防止oracle中的自动舍入? [英] How to prevent auto rounding in oracle ?
问题描述
Hello Everyone,
我需要一个解决方案来防止在oracle中自动舍入数字。在这里,我正在解释我想要的东西。请完成这个流程。
SQL>创建表dm_demo(没有数字(23,9));
创建表格
SQL>插入dm_demo值(9999999.999999999);
插入1行
SQL> select * from dm_demo;
NO
-------------------- -----
10000000.000000000
现在如果我使用to_char()那么它会显示正确的数字。但问题是我不想使用to_char()。
SQL>从dm_demo中选择to_char(no);
TO_CHAR(NO)
-------------- --------------------------
9999999.999999999
请帮我完成这项任务,如果您有其他解决方案,请告诉我。谢谢。
Hello Everyone,
I need one solution to prevent automatic rounding of number in oracle. Here I am explaining what I want.Please go through this flow.
SQL> create table dm_demo(no number(23,9));
Table created
SQL> insert into dm_demo values (9999999.999999999);
1 row inserted
SQL> select * from dm_demo;
NO
-------------------------
10000000.000000000
Now if i use to_char() then it will show me the correct figure. But the thing is I don't want to use to_char().
SQL> select to_char(no) from dm_demo;
TO_CHAR(NO)
----------------------------------------
9999999.999999999
Please help me out to accomplish this task and Please let me know if you have some other solutions. Thank You.
推荐答案
作为 Tom Kyte说 [ ^ ]:
SQLPlus has a default number format is uses to display data on the screen "nicely". You need to
either
o set the numformat to something you like
o use a TO_CHAR on the number with a format that applies in your case.
在oracle中显示小数点后的数字我们在数字datatype.check中使用精度的概念
in oracle to display a numbers after the decimal point we use the concept of precision in the number datatype.check about it
这篇关于如何防止oracle中的自动舍入?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!