select id,s1,length(s1),lengthb(s1),length(substr(s1,1,2)),lengthb(substr(s1,1,2)),length(substrb(s1,1,2)),lengthb(substrb(s1,1,2)) from (
select 1 id,'44619900715Xw' s1 from dual union all
select 2 id,'44619900715Xw' s1 from dual
)
对全角而已,最容易报错的是字符串缓冲太小,因为substr取2位,其实是4个字节,要varchar2(4)才能装满,varchar2(2)肯定装不下。所以substr操作前可先to_single_byte。