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: Daniel Morgan <dmorgan_at_exesolutions.com>
Date: Mon, 16 Sep 2002 16:10:45 GMT
Message-ID: <3D860251.AA44AF5A@exesolutions.com>


"Jaap W. van Dijk" wrote:

> 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.
> >

Can anyone actually duplicate his experience?

Daniel Morgan Received on Mon Sep 16 2002 - 11:10:45 CDT

Original text of this message

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