ALTER statement: Why VARCHAR2(50 BYTE) instead of VARCHAR2(50 CHAR)?
36,879
Answering myself (thanks to the tip provided by this other answer):
I should have executed instead:
ALTER TABLE USERX.MY_TABLE MODIFY (LASTNAME VARCHAR2(50 CHAR));
(note the extra CHAR
after 50)
Author by
Withheld
Updated on July 29, 2022Comments
-
Withheld almost 2 years
I executed the following (Oracle 11g) SQL statement to increase an existing column's length from VARCHAR2(20 CHAR) to VARCHAR2(50 CHAR):
ALTER TABLE USERX.MY_TABLE MODIFY (LASTNAME VARCHAR2(50));
It succeeded without incident, but when I look at the new
Data Type
column, I see:VARCHAR2(50 BYTE)
instead ofVARCHAR2(50 CHAR)
.My questions are:
- Why BYTE and not CHAR? What have I done incorrectly?
- How do I fix the column's length to be
VARCHAR2(100 CHAR)
?