I know that I can declare a varchar2
using the number of the characters that it should be able to contain.
However, in an Oracle
database on which I am working, I found that a field (named PDF) is defined as follows:
VARCHAR2(1 BYTE)
What does this mean? How many characters can it contain?
Another, related question: What is the difference between a VARCHAR
and a VARCHAR2
?
You can declare columns/variables as varchar2(n CHAR) and varchar2(n byte).
n CHAR means the variable will hold n characters. In multi byte character sets you don't always know how many bytes you want to store, but you do want to garantee the storage of a certain amount of characters.
n bytes means simply the number of bytes you want to store.
varchar is deprecated. Do not use it. What is the difference between varchar and varchar2?