What is the difference between CHAR and VARCHAR2? If
VARCHAR2 serves the uses of CHAR why CHAR is still used and
not been discarded yet?
Answer Posted / madhavi
Hi,
Char is the datatype that occupies complete space declared
whether used or not. ie:- If any field is declared as char
(10) then this field for all records will occupy complete
10 bytes whether the value stored in it is 1 byte or 10
byte.
Whereas Varchar2, as the first 3 characters explains Var-
Variable, will occupy only the bytes for the value entered
in the field.
So ideally it is good practice to declare fields like
emp_flg or any other fields which we are sure will have
fixed length value as Char.
| Is This Answer Correct ? | 8 Yes | 0 No |
Post New Answer View All Answers
Can we join same table in sql?
What is linq to sql?
How to make a copy values from one column to another in sql?
How do you exit in sql?
What is sql architecture?
What is a column in a table?
What is microsoft t sql?
How do I edit a stored procedure?
What is data modelling in sql?
What are different sql data types?
What is clause in sql?
What is a behavioral trigger?
What is not null in sql?
What will you get by the cursor attribute sql%found?
What is the maximum number of columns in sql table?