Home » Developer & Programmer » Reports & Discoverer » decode a numeric value to string in report
decode a numeric value to string in report [message #248493] Fri, 29 June 2007 03:39 Go to next message
Messages: 1
Registered: June 2007
Location: Malaysia
Junior Member


I'm a newbie in report. Let say I have a table Address, and one of the column on Address table is AddressType. The column data type is number. However when I want to generate the report of Address table, the data in AddressType column have to be decoded.


1- Corresponding address
2- Office address
3- home address...etc..


how do I do this?

[Updated on: Fri, 29 June 2007 03:40]

Report message to a moderator

Re: decode a numeric value to string in report [message #248517 is a reply to message #248493] Fri, 29 June 2007 05:24 Go to previous message
Messages: 21146
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Model you've described is not enough. Where do you take corresponding / office / home addresses from? Because, I doubt your intention is to get exactly the same output as you've posted it. However, if it really was the case, use DECODE or CASE (such as in this example):
WITH test AS
  (SELECT LEVEL address_type 
   FROM dual
SELECT DECODE(address_type, 1, 'Corresponding address',
                            2, 'Office address',
                            3, 'Home address'
             ) result
FROM test;

Corresponding address
Office address
Home address
Previous Topic: Problem While Printing Report
Next Topic: Printing Problem - Froms & Report 10g
Goto Forum:

Current Time: Thu Aug 17 08:52:04 CDT 2017

Total time taken to generate the page: 0.10110 seconds