我想在Oracle數據庫中插入中文字符。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)列?
只是爲了澄清:不管哪個被選擇的定義,限制爲4000個字節(或32K在Oracle 12c的擴展數據類型) – Alfabravo