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
What is procedure in pl sql?
What is the maximum rows in csv?
What is the difference between truncate and drop statements?
What is acid property in a database?
How does an execution block start and end in pl sql?
What are the different types of a subquery?
how to use regular expression in pattern match conditions? : Sql dba
What are the types of optimization?
What are conditional predicates?
Does user triggers have entry for trigger with compilation errors?
Why do we need pl sql?
Explain the commit statement.
What is restrict in sql?
How delete a row in sql?
how do you tune the slow running queries in oracle db , explain the methodology