Number data type showing up as # in SQL Plus

淺唱寂寞╮ 提交于 2019-12-22 05:13:28

问题


Number data type showing up as # instead of the numbers in SQL Plus.

Please refer to the H_RATE for the issue prevously it was showing up correctly and I have searched the internet and stackoverflow for a simliar issue or answer but none have the same.

Could you help in fixing it so it shows the number instead of #?


回答1:


# is displayed if the value can't fit in the column; from the SQL*Plus documentation:

If a value cannot fit in the column, SQL*Plus displays pound signs (#) instead of the number.

If it was displaying OK and now isn't, I think you've probably set a column format that is too small for the values you're display, something like column h_rate format 9999999999. If you have a 10-digit number that isn't enough, as it needs a character to display a +/- sign.

You can check if that is the case by clearing all column definitions, with clear columns.




回答2:


Your H_RATE format may be of smaller digits that of the data:

select to_char(123,'99') from dual; --returns ###

but do proper formatting some thing greater than the data:

select to_char(12345,'99,999') from dual; -- returns 12,345

There are various formatting by oracle given here



来源:https://stackoverflow.com/questions/20149371/number-data-type-showing-up-as-in-sql-plus

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!