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 / satish asnani
Technically CHAR has better performance than VARCHAR2.
For CHAR(10) database already knows the length of value in
each record and therefore displays the entire string up till
10 characters. In case of VARCHAR2 the end of string has to
be reached('\0'-NULL) before the database stops displaying
the characters ahead. Each character is compared to NULL
character before it can be determined that end of string has
arrived. Comparing each string character with NULL character
consumes some CPU cycles and hence VARCHAR2 is slower in
performance as compared to CHAR.
Is This Answer Correct ? | 6 Yes | 0 No |
Post New Answer View All Answers
How does left join work in sql?
what are the t string functions available in tsql? : Transact sql
What is procedure explain with example?
What is dialect in sql?
How do you add a column to a table?
What is sql and how does it work?
What is mutating trigger?
How many types of keys are there in sql?
Does sap use sql?
How do I install sql?
What is sql clause?
How do I run pl sql in sql developer?
What is dense_rank in sql?
How to run sql*plus commands in sql developer?
What are variables in pl sql?