What is difference between CHAR and VARCHAR2?What is the
maximum SIZE allowed for each type?
Answer Posted / roopesh kumar
Varchar2: The max. allowed length is 4000 byte default 0
i.e. nothing. This is variable length datatype. it will
take only same space as value stored.
Char: Max. permitable length 2000 byte. Default length 0.
It will store value blank padded to right side till
full length as declared.
Ex. SQL> create table fg (d varchar2);
create table fg (d varchar2)
*
ERROR at line 1:
ORA-00906: missing left parenthesis
SQL> create table fg (d char);
Table created.
SQL> desc fg
Name Null? Type
------------------------------- -------- ----
D CHAR(1)
SQL> create table cher_chk (col1 char(12));
Table created.
SQL> insert into cher_chk values ('raj');
1 row created.
SQL> select length(col1) from cher_chk
2 /
LENGTH(COL1)
------------
12
| Is This Answer Correct ? | 17 Yes | 5 No |
Post New Answer View All Answers
Is clustered index a primary key?
ERROR:Insert or update on table"accnt" violates foreign key constraints "acct_to_curr_symbol" DETAILS:KEY(accnt_curr_id)(-2)is not present in the table "curr_symbol" ......solve The Problem..
When is the explicit cursor used ?
What is sqlite used for?
How do I start pl sql?
how to implement one-to-one, one-to-many and many-to-many relationships while designing tables? : Sql dba
What are the types of keys?
How do I run a program in pl sql?
what is table? : Sql dba
Can I create table without primary key?
What are tables and fields in the database?
what are the differences between char and varchar? : Sql dba
how to use regular expression in pattern match conditions? : Sql dba
Explain foreign key in sql?
Is a table valued function object?