October 2002
Beginner
864 pages
18h 41m
English
These three conversion functions provide a handy way of converting one type of data to another. These examples use the table CONVERSIONS.
SQL> SELECT * FROM CONVERSIONS;
NAME TESTNUM
--------------- ---------
40 95
13 23
74 68
The NAME column is a character string 15 characters wide, and TESTNUM is a number.
The primary use of TO_CHAR is to convert a number into a character. Different implementations may also use it to convert other data types, like Date, into a character, or to include different formatting arguments. The next example illustrates the primary use of TO_CHAR:
SQL> SELECT TESTNUM, TO_CHAR(TESTNUM) 2 FROM CONVERT; TESTNUM TO_CHAR(TESTNUM) --------- ----------------- 95 95 23 23 68 68
It is not very ...
Read now
Unlock full access