GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Oracle  >  SQL Plus
Go To First  |  Previous Question  |  Next Question 
 SQL Plus  |  Question 18 of 132    Print  
What is difference between CHAR and VARCHAR2

  
Total Answers and Comments: 4 Last Update: October 27, 2006   
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
May 30, 2005 12:39:24   #1  
bharath        

RE: What is difference between CHAR and VARCHAR2
char is a fixed length charater data type.
varchar is a variable length length character data type.

 
Is this answer useful? Yes | No
June 10, 2005 06:14:48   #2  
sajida        

RE: What is difference between CHAR and VARCHAR2
Char will store null values even if the data inside the field is less than the specified length. Storage will be same as specified length.
Varchar2 will store null values if data is less than specified length storage will be that much only.

 
Is this answer useful? Yes | No
August 16, 2005 05:20:29   #3  
srinivasan        

RE: What is difference between CHAR and VARCHAR2
A varchar2 datatype when stored in a database table uses only the space
allocated to it. If you have a varchar2(1999) and put 50 bytes in the table we
will use 52 bytes (leading length byte).

A char datatype when stored in a database table always uses the maximum length
and is blank padded. If you have char(1999) and put 50 bytes into it it will
consume 2001 bytes (leading length field is present on char's as well).

In the database -- a CHAR is a VARCHAR that is blank padded to its maximum
length.

 
Is this answer useful? Yes | No
October 27, 2006 05:02:36   #4  
DJ        

RE: What is difference between CHAR and VARCHAR2

Can anyone tell me the diffrence between CHAR and VARCHAR2(1)...

why do we use char when we can give it as varchar2(1)..????

Thanks in advance..


 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape