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: Varchar search is very literal

Re: Varchar search is very literal

From: Frank <frankbo_at_interaccess.nl>
Date: Thu, 31 Aug 2000 16:53:43 +0200
Message-ID: <39AE7177.B8C85BAE@interaccess.nl>

and... don't use varchar, but varchar2!
AFAIK, varchar is not supported in V8

greetz, Frank

Sybrand Bakker wrote:
>
> This is just the way it is:
> varchar means varying length semantics, ie strings are not padded before
> comparison
> char means fixed length semantics, strings are padded before comparison.
> I don't know why you want to store redundant spaces, you could of course
> always use rtrim before insert and update to make sure, they don't reach
> your database.
>
> Hth,
>
> Sybrand Bakker, Oracle DBA
>
> <jgotthelf_at_my-deja.com> wrote in message news:8ojqfu$8k5$1_at_nnrp1.deja.com...
> > Hi,
> >
> > I have found that with a varchar2 field that searches seem to care
> > about trailing spaces, i.e.:
> >
> > create table fred (fld1 varchar(10))
> > insert into fred values ('cat ') -- 4 spaces after 'cat'
> > commit
> >
> > select * from fred where fld1 = 'cat'
> >
> > returns zero rows. With regular 'Char' this works just fine.
> >
> > Is there a way to alter this behavior, or is this just the way it is?
> >
> >
> > Sent via Deja.com http://www.deja.com/
> > Before you buy.
Received on Thu Aug 31 2000 - 09:53:43 CDT

Original text of this message

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