判断字段中是否含有中文字符的实例脚本

2008-01-31 09:12:58.0     推荐:0    收藏:0    评论:0     来源:赛迪网

本文中length代表的是字的长度,lengthb是字节的长度,字符集为UTF8。

SQL> create table test(a varchar2(20));

Table created

SQL> insert into test values('2');

1 row inserted

SQL> insert into test values('12');

1 row inserted

SQL> insert into test values('玲珑剔透');

1 row inserted

SQL> commit;

Commit complete

SQL> select * from test;

A
--------------------
2
12
玲珑剔透

SQL> select a from test where length(a)!=lengthb(a);

A
--------------------
玲珑剔透

SQL> select a from test where asciistr(a) not like '%%';

A
--------------------
2
12

SQL> select a from test where asciistr(a) like '%%';

A
--------------------
玲珑剔透
您可以针对本文进行:[评论]  [收藏]  [推荐]   [查看原文链接]  
  • 共有0条评论  点击查看更多评论
  • 网友评论仅供网友表达个人看法,并不表明e800同意其观点或证实其描述
我想发表评论:
用户名密码
  • 匿名发表
    验证码: