Difference between CHAR and VARCHAR2 in Oracle

          

Difference between CHAR and VARCHAR2 in Oracle

<<Previous  Next>>

Oracle - Differences between CHAR and VARCHAR2 - Feb 07, 2010 at 14:20 PM by Shuchi Gauri

Differences between CHAR and VARCHAR2 in Oracle.

CHAR is used to store fixed length character strings where as Varchar2 can store variable length character strings. However, for performance sake Char is quit faster than Varchar2.
If we have char name[10] and store “abcde”, then 5 bytes will be filled with null values, whereas in case of varchar2 name[10] 5 bytes will be used and other 5 bytes will be freed.

Oracle - Differences between CHAR and VARCHAR2 - June 27, 2009 at 11:00 AM

Differences between CHAR and VARCHAR2 in Oracle.  

CHAR values have a fixed length. They are padded with space characters to match the specified length.

VARCHAR2 values have a variable length. They are not padded with any characters.

Also read
Oracle composite data types

What is composite data type? Explain the types of composite data type...............

Oracle data types

Explain the differences between char and varchar2 data types, Explain BLOB, CLOB, NCLOB and BFILE, Explain ROWID in oracle, What is a LOB data type?...........

Oracle object datatypes

Object data types are user defined data types. Both column and row can represent an object type.................

<<Previous  Next>>



Write your comment - Share Knowledge and Experience


 

 
Interview questions
Latest MCQs
» General awareness - Banking » ASP.NET » PL/SQL » Mechanical Engineering
» IAS Prelims GS » Java » Programming Language » Electrical Engineering
» English » C++ » Software Engineering » Electronic Engineering
» Quantitative Aptitude » Oracle » English » Finance
Home | About us | Sitemap | Contact us | We are hiring