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: STRANAGE SELECT BEHAVIOR

Re: STRANAGE SELECT BEHAVIOR

From: Jaap W. van Dijk <j.w.vandijk.removethis_at_hetnet.nl>
Date: Sun, 15 Sep 2002 22:13:12 +0200
Message-ID: <k9q9oushj9h356goq9e47akv7obtkropdo@4ax.com>

Yes and that's why the thread is called 'Strange SELECT behaviour'.

even if you were right, that doesn't explain the difference in result between query 1 and 2.

Jaap.

On Sun, 15 Sep 2002 16:03:06 GMT, "Jim Kennedy" <kennedy-family_at_attbi.com> wrote:

>They seem to matter inhis example.
>"Jaap W. van Dijk" <j.w.vandijk.removethis_at_hetnet.nl> wrote in message
>news:ao49oucc3o9fovmm81ipvfn1mv000et0pg_at_4ax.com...
>> On Sat, 14 Sep 2002 17:07:16 GMT, "Jim Kennedy"
>> <kennedy-family_at_attbi.com> wrote:
>>
>> >Read the documentation on data types (sql reference manual). If you are
>> >using char then everything is blank padded and so you have to compare
 with
>> >the blanks. You should be using varchar2 which is not blank padded and
 then
>> >you don't have to pad the queries with blanks.
>> >Jim
>> ...
>>
>> No, it's the other way around. Trailing spaces when comparing CHAR
>> fields don't matter: Oracle will right pad the shorter field until it
>> is as long as the longer field and then do the comparison. When using
>> VARCHAR2 Oracle will use the trailing spaces you have specified. So (b
>> is for blank) if you have stored 'X' in a VARCHAR2 field in the
>> database is will not be the same as the literal 'Xb'.
>>
>> Jaap.
>
Received on Sun Sep 15 2002 - 15:13:12 CDT

Original text of this message

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