将 oracle 中的负数转换为十六进制会给出错误的输出?
Converting a negative number in oracle to Hexadecimal is giving wrong output?
我正在使用下面的 select 语句将正数转换为十六进制
SQL>select to_char('2122699925', 'XXXXXXXXXXXXXXXX') from testable
Output : 7E85D495
但是负数的 TO_CHAR 输出为 #################
SQL>select to_char('-2122699925', 'XXXXXXXXXXXXXXXX') from testable
Output : #################
要求的输出应该是817A2B6B。有什么想法吗?
文档说(Table 2-13 数字格式元素),here
Returns the hexadecimal value of the specified number of digits. If the specified number is not an integer, then Oracle Database rounds it to an integer.
Restrictions:
This element accepts only positive values or 0. Negative values return an error.
.......
但是我能够找到下面的 link 进行负数对话。我无意复制它,但如果它对您有任何帮助,请提供给您 link,
我正在使用下面的 select 语句将正数转换为十六进制
SQL>select to_char('2122699925', 'XXXXXXXXXXXXXXXX') from testable
Output : 7E85D495
但是负数的 TO_CHAR 输出为 #################
SQL>select to_char('-2122699925', 'XXXXXXXXXXXXXXXX') from testable
Output : #################
要求的输出应该是817A2B6B。有什么想法吗?
文档说(Table 2-13 数字格式元素),here
Returns the hexadecimal value of the specified number of digits. If the specified number is not an integer, then Oracle Database rounds it to an integer.
Restrictions:
This element accepts only positive values or 0. Negative values return an error.
.......
但是我能够找到下面的 link 进行负数对话。我无意复制它,但如果它对您有任何帮助,请提供给您 link,