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: Michael Ringbo <mhr_at_NOSPAMramboll.dk>
Date: Fri, 02 Jul 1999 12:42:01 +0200
Message-ID: <377C9779.70254D7D@NOSPAMramboll.dk>


Hi,

No comments, just a solution:

Try decode(substr(contract,length(contract),1), 'Q', Line*4, 'M', Line*12, 'H', Line*2, 'Y', Line, 0)

The trick is of course to 'strip' your contracts to the specific values.

Hope this helps.

Regards,
Michael Ringbo

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 - 05:42:01 CDT

Original text of this message

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