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

Answer Posted / sravanthi

Let us declare to variables as below:
v_empname CHAR2(10) := 'BILL';
v_depname VARCHAR2(10) := 'HRD';
the database allocates 10 bytes memory for v_empname and
just 3 bytes memory for v_deptname.
when a variable is declared varchar then the memory will be
allocated variably.
So,if one is not sure of the data that the variable is
going to hold then VARCHAR2 should be used instead of CHAR
during declaration.

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What do you mean by query optimization?

730


Why we use cross join?

703


Why do we use joins?

777


how can we destroy the session, how can we unset the variable of a session? : Sql dba

729


what is an extent ? : Sql dba

751






Explain what is table in a database?

783


When to use inner join and left join?

695


What is a mutating table and a constraining table?

758


What is the difference between unique and primary key constraints?

777


What is sql keyword?

755


What are the set operators in sql?

776


What are tables and fields?

762


what is commit? : Sql dba

817


What are the two types of periodical indexes?

662


explain the difference between myisam static and myisam dynamic. : Sql dba

705