2
I have a question regarding the types of data in oracle:
In Oracle, What is the difference between varchar and varchar2?
2
I have a question regarding the types of data in oracle:
In Oracle, What is the difference between varchar and varchar2?
5
SWEEP
Currently (up to 11G version of Oracle Database), VARCHAR is nothing more than a synonym for VARCHAR2 (since the Oracle8), therefore the Oracle recommends not to use this type of data.
There is the possibility of VARCHAR be used in future versions to have a different semantics or characteristic of VARCHAR2, but even though everything is the same today, use VARCHAR2 instead of VARCHAR, to avoid possible future problems.
VARCHAR2
VARCHAR2 stores alphanumeric characters of variable size, between 1 and 4000 bytes or characters. The default size of this column is specified in bytes.
Now comes the question, what is the difference between storing bytes or characters?
When we use characters multibyte, as an example UTF-8 (to represent specific characters in multiple languages), 1 single character can be stored in until 3 bytes. In these cases, a word containing special characters, such as FÁBIO, may have more bytes than characters (the letter Á, internally will be stored in 2 or 3 bytes), therefore, it is recommended in these cases to specify the storage of the column in characters, instead of bytes.
Source: What kind of data should I use: CHAR, VARCHAR or VARCHAR2?
Browser other questions tagged oracle
You are not signed in. Login or sign up in order to post.
UTF-8 can use up to 4 bytes, not 3. I don’t know if the same occurs in Oracle, but in Mysql there are up to two types, UTF8 and UTF8MB4, the second is the complete, up to 4 bytes.
– Inkeliz
Is there any other difference?
– Renato Junior