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 'mysqlshow'? : Sql dba
what is the different between now() and current_date()? : Sql dba
What is the use of partition by in sql?
What is the use of nvl function?
how to run 'mysql' commands from a batch file? : Sql dba
Any attempt to navigate programmatically to disabled form in a call_form stack is allowed?
How do you bind variables in pl sql?
What is bind reference and how can it be created?
Does mysql support pl sql?
First round ------------------- - Procedure - Packages - Views - Virtual tables - Can we use dcl with in function? - Joins and few scenarios - Triggers and its type - Pragma, type and its functionality - How to create db link in oracle - Materialized view - How to find duplicate values from table? - Cursor and its functionality - Write a script to display friday and its date from a entire year. - Exception Handling Second round ------------------------ Gave a scenario like. Need to write a function to perform. When user try to change a password. It must not be last five password and a given password can be combination of characters, symbols, upper and lower case.
How do I truncate a sql log file?
What are the two characteristics of a primary key?
What is scope and visibility in PL/SQL?
What is query syntax?
What do you think about pl/sql?