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
How we can create a table in pl/sql block. Insert records into it? Is it possible by some procedure or function? Please give example?
what are different types of keys in sql?
How to prepare for oracle pl sql certification?
1) Synonyms 2) Co-related Subquery 3) Different Jobs in Plsql 4) Explain Plan 5) Wrap 6) Query Optimization Technique 7) Bulk Collect 8) Types of index 9) IF primary key is created then the index created ? 10) Foreign Key 11) Exception Handling 12) Difference Between Delete and Trunc 13) Procedure Overloading 14) Grant Revoke 15) Procedure Argument types. 16) Functions. 17) Joins
How do I count rows in sql?
define join and explain different type of joins? : Sql dba
What is the purpose of a secondary key?
Explain character-manipulation functions?
How do you get column names only for a table (sql server)?
How do you update f as m and m as f from the below table testtable?
What is auto increment feature in sql?
what are the advantages of mysql in comparison to oracle? : Sql dba
What is clause in sql?
what are the differences between require and include, include_once and require_once? : Sql dba
What are the types of records?