Hexadecimal formats for number conversion
Details
| Detail name | Value |
|---|---|
| Changelog Number | 2819 |
| Type | Improvement |
| Status | Resolved |
| Fix Versions | Exasol 6.1.0 |
| Resolution Date | 2017-04-20 |
We have extended the Numeric Format Model and the to_number and to_char functions to support conversion between decimal and hexadecimal numbers. The functionality is only supported for positive integers. ie. Negative numbers and numbers with decimal point are not supported for hexadecimal conversion. Also the conversion is only supported upto largest number of type DECIMAL(36,0).
Some examples of the functionality are as follows.
select to_number('abc', 'xxx') from dual;
--2748
select to_number('abc', 'XXX') from dual;
--2748
select to_char(2748, 'XXX') from dual;
– ABC
select to_char(2748, 'xxx') from dual;
– abc
select to_char(2748, 'XXXXXX') from dual;
– ABC
select to_char(2748, 'xxxxxx') from dual;
– abc
select to_char(2748, '0XXXXX') from dual;
– 000ABC
select to_char(2748, '0xxxxx') from dual;
– 000abc