Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Problem in escaping the single quote in DECODE

Problem in escaping the single quote in DECODE

From: Anto <antoshin_at_gmail.com>
Date: 21 May 2007 07:58:03 -0700
Message-ID: <1179759482.262681.249670@x18g2000prd.googlegroups.com>


Hi all,

I have the following query.

  SELECT MAX(emptype_flg)
    FROM employee
    AND emptype_flg IN (DECODE ('emptype_flg', '*' , emptype_flg,

                                         'S' , '*,S'));

The emptype_flg can contain values '*' or 'S'.

The problem is that when the emptype_flg contains value S, the SQL does not give any output. This is because the IN block contains ('*,S')

How can I get ('*', 'S') in the IN block so that the above query works???

Any pointers will be highly appreciated!!

Regards,
Antoshin Lazar. Received on Mon May 21 2007 - 09:58:03 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US