| SQL - Questions and Answers Have a SQL question? Post it here. First do a search to see if someone hasn't already answered it. |
|
|||
How to use BASE36 conversion in Oracle / SQL?I would like to know how to use BASE36 conversion in Oracle.
Have a problem with number system (only 5 digits) running now out of numbers and would like to use alpha characters in the numbering system ie 99999 next number A0000 Thank You |
|
|||
|
I assume you have a CHAR column in the database so you can hold the alpha characters. I don't know how to go to base 36 without a special function, but it is easy to go to hex. This would give you a maximum of 'fffff' which is decimal 1048575, over ten times the number of values you have now.
SELECT TO_CHAR(1048575,'xxxxx') FROM dual TO_CHAR(1048575,'XXXXX') ------------------------ fffff SELECT TO_NUMBER('fffff','xxxxx') FROM dual TO_NUMBER('FFFFF','XXXXX') ------------------------------ 1048575 |
![]() |
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|