PL/SQL Developer Test Window for Stored Procedure turns number value into scientific notation

北城余情 提交于 2019-12-14 04:09:43

问题


I'm using PL/SQL Developer using the Test Window to test a Stored Procedure that accepts a value of type Number. The value I'm passing to the Stored Procedure is 37788024213340161. However, I noticed that PL/SQL converts that value to scientific notation and rounds up, and passes a different value to the Stored Procedure instead: (3.77880242133402E16)

Thus, when executing the Stored Procedure, it ends up using the rounded-up value rather than the value I intended it to use. The value that ends up being passed to the Stored Procedure is 37788024213340200. Where the last 3 numbers should have been 161 but PL/SQL Developer rounded up and now the value is 200.

Is there a way to set the preferences in PL/SQL Developer so it will not change the value to use scientific notation in the Test Window?


回答1:


Oh another thing you can try to do to view the full value in the Test Window of PL/SQL Developer is to switch the type from "float" to "string"




回答2:


The numbers are stored correctly in the database. The issue is only in the way that they are displayed to you.

I don't have access to PL/SQL developer right now. But, I think you can try this: In the PL/SQL Developer's Preferences configuration dialog, check "Number fields to_char" on the SQL Window tab.




回答3:


Try this workaround

:numStr := to_char(:gecid);

This will add an output param "numStr". To see the numStr in the list of variables, press the arrow (black circle white arrow). For output param, you won't need to declare them.



来源:https://stackoverflow.com/questions/32597312/pl-sql-developer-test-window-for-stored-procedure-turns-number-value-into-scient

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