我想在Oracle数据库中插入汉字。
select length('有个可爱的小娃在旁边') from dual;
10
drop table multibyte;
create table multibyte (name varchar2(10));
insert into multibyte
values('有个可爱的小娃在旁边');
我收到一条错误消息说
An attempt was made to insert or update a column with a value
which is too wide for the width of the destination column.
The name of the column is given, along with the actual width
of the value, and the maximum allowed width of the column.
Note that widths are reported in characters if character length
semantics are in effect for the column, otherwise widths are
reported in bytes
我知道,如果我增加列宽,问题就会消失。我的问题是当长度函数告诉我宽度是 10 为什么我不能将它插入到 varchar2(10) 的列中?