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 -> Re: SQL DECODE issue where search field is Like and not specific

Re: SQL DECODE issue where search field is Like and not specific

From: Herald <aldam_at_capgemini.nl>
Date: Fri, 02 Jul 1999 13:19:38 +0200
Message-ID: <377CA04A.AC5C2C20@capgemini.nl>


I would use instead of
decode(substr(contract,-1,1),'Q',(Line*4),'M',(line*12), etc. Now Oracle checks for % which is not the case

Herald ten Dam

Peter Stephen Drage wrote:
>
> The problem is that when using a decode statement the search seems to have
> to be specific i.e. 1,2,etc. I am searching on the fact that a contract ends
> with M,H,Q,Y and the result will depend upon only the ending .
> I have entered the decode statement :-
> decode((Contract),'%Q',(Line*4),'%M', (Line*12),'%H',
> (Line*2),'%Y',(Line),0)
> I get results all of the default 0
> I have also tried %'M' and Like '%M'
> I have checked the company's Oracle SQL training manuals, specific cases are
> all that are covered.
> The only other time that I have used decode is when the search is specific
> but this has now got me baffled
> Comments and suggestions greatly appreciated
> Thanks
>
> J
Received on Fri Jul 02 1999 - 06:19:38 CDT

Original text of this message

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