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

Home -> Community -> Usenet -> c.d.o.server -> Re: puzzling thing with oracle...

Re: puzzling thing with oracle...

From: Keith Boulton <boulke_at_globalnet.co.uk>
Date: 2000/03/13
Message-ID: <38ccb3e5.752710@read.news.globalnet.co.uk>#1/1

On Sat, 11 Mar 2000 23:22:46 GMT, skudsi_at_my-deja.com wrote:

>I am calling a stored procedure from PRO*C that selects data from a
>table according to three parameters , the index (CHAR(2)) and key (CHAR
>(36))and option.
>WHEN I call the procedure with option '='
>The select * from table where index = value1 and key =value2 works
>when the option is 'LIKE'
>select * from table where index = value1 and key like value2% doesn't
>work although there should be matching data.
>If I change the stored procedure so that the parameters are VARCHAR2
>instead of CHAR() the LIKE statement works while the equal doesn't.
>

This is almost certainly because you are using CHAR and not VARCHAR2. CHAR is blank padded to the appropriate length, so I suspect the % is being appended after the trailing blanks which mean that no match is found. I can think of no reason ever to use CHAR. Received on Mon Mar 13 2000 - 00:00:00 CST

Original text of this message

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