日期:2014-05-17 浏览次数:20933 次
--os:centos 5.6
--oracle version: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
--server characterset:AMERICAN_CHINA.ZHS16GBK
--drop table idb_varchar;
--drop table idb_varchar2;
--drop table idb_nvarchar2;
create table idb_varchar(
id number,name varchar(10));
insert into idb_varchar values(1,'');
insert into idb_varchar values(2,' ');
insert into idb_varchar values(3,'a');
insert into idb_varchar values(4,lpad('中',10,'中'));
insert into idb_varchar values(4,lpad('b',10,'b'));
create table idb_varchar2
(id number,name varchar2(10));
insert into idb_varchar2 values(1,'');
insert into idb_varchar2 values(2,' ');
insert into idb_varchar2 values(3,'a');
insert into idb_varchar2 values(4,lpad('中',10,'中'));
insert into idb_varchar2 values(5,lpad('b',10,'b'));
create table idb_nvarchar2(id number,name nvarchar2(10));
insert into idb_nvarchar2 values(1,'');
insert into idb_nvarchar2 values(2,' ');
insert into idb_nvarchar2 values(3,'a');
insert into idb_nvarchar2 values(4,lpad('中',20,'中'));
insert into idb_nvarchar2 values(5,lpad('b',10,'b'));
select id,name,length(name),lengthb(name) from idb_varchar;
select id,name,length(name),lengthb(name) from idb_varchar2;
select id,name,length(name),lengthb(name) from idb_nvarchar2