Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What is difference between CHAR and VARCHAR2?What is the
maximum SIZE allowed for each type?

Answer Posted / sushant

Both CHAR and VARCHAR2 types are used to store string values but both behave very differently.



CHAR should be used to store fix length strings. String values will be space/blank padded towards right before storing on disk. If this type is used to store varibale length strings, it will waste a lot of disk space. For example we can use it to store fields where we have one character only like IS_MINOR char (1). Here we will store only 'Y' or 'N' hence it becomes a prefect candidiate for char data type.


VARCHAR2 is used to store variable length character strings. The string value's length will be stored on disk with the value itself.


Explanation with an example could be found here :

http://www.oraclebin.com/2012/11/difference-between-char-and-varchar2.html

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do I add a database to sql?

1121


How to change a value of the field ‘salary’ as 7500 for an employee_name ‘john’ in a table employee_details?

1434


How many sql statements are used?

1006


what is not null constraint? : Sql dba

1028


How show all rows in sql?

1011


What are the benefits of pl/sql packages?

1105


how many sql dml commands are supported by 'mysql'? : Sql dba

1114


Can instead of triggers be used to fire once for each statement on a view?

960


What is procedure in pl sql?

1039


Is a view faster than a stored procedure?

958


Does truncate table reset auto increment?

990


Which is better cte or subquery?

1026


how to extract a unit value from a date and time? : Sql dba

990


How do I start sql from command line?

1019


What is a primary key sql?

1039