Oracle To_Char function V in format string

馋奶兔 提交于 2019-12-13 03:34:20

问题


I was given Oracle code and I'm trying to figure out what it is doing. Specifically it's converting a number to a string and I don't understand it.

The code is:

TO_CHAR(QTY_DISPENSED,'0000000V000') 

What does the V do?

Jeff


回答1:


It's a "Format Model" for converting numbers to strings: https://docs.oracle.com/cd/B19306_01/server.102/b14200/sql_elements004.htm

Returns a value multiplied by 10n (and if necessary, round it up), where n is the number of 9's after the V.

So basically it's taking your QTY_DISPENSED multiplying it by 1000 and returning a string.



来源:https://stackoverflow.com/questions/51367212/oracle-to-char-function-v-in-format-string

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