Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: V7 VARCHAR2/CHAR usage
Greetings Reinhold,
>up to ORACLE V6 there was only a variable-length string datatype (CHAR).
Now
>there is VARCHAR2 and CHAR. For known fixed-length values this might be
an
>improvement in disk usage. On the other hand I now have to consider
>different comparison rules, etc. I was pretty satisfied with one string
>type. Is it worth using two?
I am in the process of converting an application originally written in Informix, converted to Oracle 6, and now Oracle 7.
I would tend to stay away from CHAR datatype unless I really needed a fixed length record, and offhand I can't think of any such use, that I couldn't do with VAARCHAR2.
With CHAR there is an additional "gotcha" is you use the datatype if Forms 4. Because expressions are parsed in a different way from SQL*Plus and Forms, the same statement may work in Plus but not in Forms.
The problem appears to be caused by the trailing blanks. I have tried to compare strings where both were trimmed, and it still wouldn't work
I am now restructuring the tables, changing all the CHAR datatypes to VARCHAR2, and re-selecting the data using LTRIM(RTRIM()) to strip off the trailing spaces.
That is my assessment of it.
Regards
Alex Long along_at_baea.com.au
The usual disclaimers apply, the above is my opinion alone, and does not in any way reflect the opinion or policy of my clients. Received on Mon Mar 13 1995 - 20:47:15 CST