Re: Difference between CHAR vs VARCHAR
Date: 1995/07/28
Message-ID: <3v9in2$lrb_at_sulla.cyberstore.ca>#1/1
> gbrown_at_partech.com (George Brown) writes:
> 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
>
>>>>
George,
To paraphrase the SQL Manual:
CHAR is fixed length character string (it will blank pad any string shorter than the specified length) VARCHAR2 is variable length character string (no padding) VARCHAR is currently the same as VARCHAR2 (but Oracle reserves the right to change it in the future). Therefore, don't use this datatype if you want to avoid possible future headaches! Use VARCHAR2 instead.
To understand why the queries didn't work, find a SQL Language Reference Manual and look up the "Datatype Comparison Rules". It explains it much better than I could.
Good luck,
Gary Wong
Received on Fri Jul 28 1995 - 00:00:00 CEST