Re: char vs varchar ?

From: Alex Long <paladin_at_along.dialix.oz.au>
Date: 1995/04/29
Message-ID: <25_at_along.dialix.oz.au>#1/1


 

In article <3nr1c3$5so_at_maverick.tad.eds.com>, Bob Wuller (rew_at_sfsv.opr.eds.com) writes:
>In article <3n5vrf$bqo_at_cardinal.fs.com>, skannan_at_PROBLEM_WITH_INEWS_GATEWAY_FILE ( S. Kannan) says:
>>
>> Varchar and Varchar2 are currently synonymous. However Oracle Corporation
>> may change the way Varchar works, in a future version.
>>
>> The difference between char and varchar in Oracle 7 and above is that
>> char is fixed length and can store upto 255 characters. Varchar (or
>> Varchar2 currently) is variable length and can store upto 2000 bytes
>
>With Oracle 7, is their a performance decrease when using both fixed and varchar fields?
>
>We are designing a database using a CASE tool. We want to use both fixed and varchar fields
>because the database will be generated for both Oracle (on the workstation) and DB2
>(on the mainframe). DB2 runs faster with fixed fields than varchar fields.
>
>Now another group will access our database with other tools, including Oracle Forms.
>They want us to define all fields as varchar instead of our current design, which mixes
>fixed and varchar fields.

Hi Bob,

Asides from the fact that CHAR is a fixed length data_type, and will be right padded with spaces (As I am sure has been mentioned by many people), there is one crucial difference you may need to keep in mind.

If you use a CHAR data_type in a SQL*Forms 4 to 4.5 application, you cannot use that field to establish a relationship like Master-Detail.

It is the result of the way Forms creates the query. To see the difference, force an error condition in Forms, and then display the error.

I have queried this with Oracle, and they concur that it may be a problem under certain circumstances. It has not been changed for Forms 4.5 because it works they way it is supposed to, which is a pain in the a...neck.

Regards,
Alex Long

--
                          ,     \    /      ,
                         / \    )\__/(     / \   
                        /   \  (_\  /_)   /   \                
 ______________________/_____\__\_at_  @/___/_____\________________ 
|paladin.along.dialix.oz.au 					|
|Alex Long 		   					|		
|Adelaide, South Australia 					|
|_______________________________________________________________|
|Wiv a ladder and some glasses,                			|
|You copuld see to 'Ackney Marshes,           			|
|If it wasn't for the 'ouses in between.       			|
|Edgar Bateman					                |
+_______________________________________________________________+
                   |    /\ /      \\       \ /\    |             
                   |  /   V        ))       V   \  |
                   |/     `       //        '     \|
                   `              V                '
                   
_
Received on Sat Apr 29 1995 - 00:00:00 CEST

Original text of this message