Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DECODE function

Status
Not open for further replies.

fc2

IS-IT--Management
Jun 3, 2005
1
IE
Hi,

Is it possible to put a like('') function inside a decode function as follows:
Code:
DECODE(Reference,like('%_%'),'Has Underscore','No Underscore')
I am attempting to decode a value and if it contains an underscore I want to display 'Has Underscore', else 'No Underscore'.

Can this be done? I keep getting errors!
 
I'd use a CASE WHEN construct

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Code:
DECODE(INSTR(Reference,'_'),0,'No Underscore','Has Underscore')
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top