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: Strange result using: select and the '=' sign?

Re: Strange result using: select and the '=' sign?

From: TurkBear <johng_at_mm.com>
Date: Wed, 22 Mar 2000 15:20:58 GMT
Message-ID: <38d8e401.3018570@204.181.81.99>

I think the problem is with the blank-padding 'feature' of Oracle and Varchar2 field data..

If you tableCol is Varchar2(10) try this: select * from tableName where tableCol = '1234 '; In other words, for an equate, you need to match the column size with the where statement ( in the above example there are 10 chars in the '1234 ' ---when Oracle says = , it means exactly match...The other operators are not as 'fussy'

Christer Wallentin <christer.wallentin_at_media.sema.se> wrote:

>When making a selection using :
>
>SELECT * FROM tableName WHERE tableCol = '1234'
>
>It won't return anyting. (The tableCol is of the VARCHAR2 type)
>
>The following works:
>
>SELECT * FROM tableName WHERE tableCol = TO_CHAR(1234)
>
>SELECT * FROM tableName WHERE tableCol >= '1234'
>
>SELECT * FROM tableName WHERE tableCol <= '1234'
>
>SELECT * FROM tableName WHERE tableCol BETWEEN '1234' AND '1234'
>
>And also the way that I have solved the problem with att the moment:
>
>SELECT * FROM tableName WHERE tableCol >= '1234' AND tableCol<='1234'
>
>Have I made a fatal misstake, is it a bug or???
>
>christer.wallentin_at_notes.sema.se

-----= Posted via Newsfeeds.Com, Uncensored Usenet News =----- http://www.newsfeeds.com - The #1 Newsgroup Service in the World! -----== Over 80,000 Newsgroups - 16 Different Servers! =----- Received on Wed Mar 22 2000 - 09:20:58 CST

Original text of this message

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