During a conversation with a coworker, I was told that it is BETTER to use varchar2(1) than to user char1(1).
Can someone please shed some light into this.
Thanks in advance.
zik
VARCHAR2 is better than CHAR, storage-wise because no space will be padded in varchar2 when full lenght is not utilized, but VARCHAR2(1) and CHAR(1) will always be the same because no space will be padded since you only have two value options for char, a single character value and a null.
Robbie
"The rule is, not to besiege walled cities if it can possibly be avoided" -- Art of War
Not strictly true. Varchar2(1) will use more space than char(1), since it is variable length Oracle will store the length in the row header in 3 bytes, instead of the 1 byte row header used by char(1). So varchar2 will be stored in minimum of 3 bytes, as apposed to the 2 used by char. However, Oracle are phasing out the use of char & recommend that varchar2 is used.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.