PPT Slide
Using the rpad( ) function in SELECT statements:
As shown in the following code, these two functions can
be used to place additional filler characters on the right
side of data in a column out to a specified column width.
The output from one SQL function can be used as input
for another. The rpad( ) operation will pad the decoded
SEX column out to ten characters with dashes.
SELECT empid, lastname, firstname, RPAD(DECODE(sex,'M','MALE','F','FEMALE'),10,'-') sex
FROM empORDER BY empid DESC;EMPID LASTNAME FIRSTNAME SEX----- -------- --------- ----------60403 HARPER ROD MALE------49539 QIAN LEE FEMALE----49392 SPANKY STACY FEMALE----39334 SMITH GINA FEMALE----02039 WALLA RAJENDRA MALE------