hai,

when to use char and varchar2....?


















































Answer Posted / gangaram

char- should be use when you know that the number of
characters in the coloumn field is constant .ex if the
gender is coloumn with char(1)- so only M and F are the two
options so char(1) is better to use than varchar2.
varchar2- first of all varchar2 is a oracle standard.
varchar2 is nothing but variable characters.
ex- if you have defined the column with varchar2(50) and
when u r inserting the record into that column with only 10
letter/characters then only 10 bits will be used instead of
50.
but if u declare char(50) full 50 bits is allocated for
that column. so even if u enter on 20 characters the space
utilized will be full 50 bits.

Is This Answer Correct ?    13 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why should I use oracle database?

569


Tab A A B ------ 1 A 2 B 3 C Tab B A B ----- 4 D 5 E 6 F Generate the value into B table from A table. Only table A has the value. Write the SQL query to get B table value.

1260


If youre unsure in which script a sys or system-owned object is created, but you know its in a script from a specific directory, what UNIX command from that directory structure can you run to find your answer?

1654


How to start a specific oracle instance?

582


what is the dual table in oracle?

549






Why oracle is used?

578


Explain the function of optimizer in oracle?

593


What is the difference between post-database commit and post-form commit?

511


How does propagation differ between Advanced Replication and Snapshot Replication (read-only)?

1827


Differentiate between translate and replace?

625


what is difference between sql plus and sql*plus? (not sql and sql plus).

3342


Can we save images in a database and if yes, how?

588


What is meant by a deadlock situation?

573


What is oracle and what are its different editions?

573


How to initialize variables with default values?

633