Re: Difference between CHAR vs VARCHAR

From: Dale E. Benjamin <dbenjamin_at_fcpa.fujitsu.com>
Date: 1995/07/28
Message-ID: <3v9kab$ddd_at_fujitsui.fujitsu.com>#1/1


In Oracle7...
Varchar2 (and currently varchar) store variable length character strings.

Char stores fixed lenght (i.e. ABCDE in a char(10) is stored with 5 whitespace characters at the end).

Varchar is around for future compatibility, and its definition may change. Oracle recommends using varchar2 if you want to store variable length character strings (per sql lang ref man pg 2-23).

Using like will allow you to match a variable length string with a char field. (e.g. where char_field like 'ABCDE%').

gbrown_at_partech.com (George Brown) wrote:
>What is the difference between CHAR and VARCHAR? I have had some problems
>with queries on CHAR that I had to solve by doing LIKE. I also could not
>develop a Forms 4.0 master-detail application using a CHAR data type
>relation; NUMBER worked fine...
>--
>George Brown Voice: 315-738-0600x250
>8383 Seneca Turnpike FAX: 315-738-8304
>New Hartford, NY 13413-4991 e-mail: george_at_partech.com
> URL: http://www.partech.com
Received on Fri Jul 28 1995 - 00:00:00 CEST

Original text of this message