ABSTRACT

Many of us have wondered why we cannot have a format function to format the alphanumeric character data on the lines of the DATATYPE conversion functions such as TO_DATE, TO_NUMBER, and TO_CHAR. These independent conversion functions are excellent instruments in datatype conversions as well as data formatting. However, the implicit premise with these conversion functions is that you are trying to convert the datatype of given data. For example, if we want to convert a number 99 into a format of 99.00, we can use the TO_CHAR function viz. TO_CHAR(99,’99.99’) to yield a 99.00 as the data value. However, in the event of this use of the TO_CHAR function, the format mask supplied is “hard-coded.” So, if a number larger than two digits comes as the data input, the resulting output is “#####” as the data value exceeds the format mask supplied for the purpose. There is a very practical requirement to format data in data interfacing and data conversion programs where the source data is emanating as a character datatype, whereas the contents of the data value are all numeric.