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: CHAR field type - always spaces?

Re: CHAR field type - always spaces?

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Sun, 08 Nov 1998 08:14:37 +0100
Message-ID: <364544DD.D8261A28@sybrandb.demon.nl>


Oracle 6 CHAR is varying, Oracle 7 CHAR is fixed length. No it will always be padded.
Your code can have disadvantages though. If field_name is indexed, the function to trim it, will preclude using indexes. I wouldn't use CHAR unless I am dead sure the length is fixed (like 'M' and 'F' for male and female).

Regards,

Sybrand Bakker, Oracle DBA

Peter Shaw wrote:

> In my experience, when quering on a CHAR field type, this search is much
> faster:
>
> FIELD_NAME = 'sample '
>
> (pad the criteria with spaces to equal the field length) than this search:
>
> TrimRight(FIELD_NAME) ='sample'
>
> But someone told me recently that you cannot always assume that CHAR field
> types will be padded with spaces. I have never found a case that this is
> not true.. Is this right? Feedback?
Received on Sun Nov 08 1998 - 01:14:37 CST

Original text of this message

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