--Count the length of string
select lengthb('select * from scott.emp') as countted_by_byte, length('select * from scott.emp') as countted_by_char from dual; --For some character encoding, the length() and the lengthb() is same in english
--you may use this feature to check whether the string constains the chinese char
declare
v_char varchar2(50) := 'hello world你好';
begin if lengthb(v_char) = length(v_char) then
dbms_output.put_line('it have not chinese...');
else
dbms_output.put_line('it have chinese...');
end if; end;

Oracle PLSQL Demo - 22.查看字符串的长度[lengthb, length],判断字符串是否包含中文的更多相关文章

  1. 灵魂拷问:Java如何获取数组和字符串的长度?length还是length()?

    限时 1 秒钟给出答案,来来来,听我口令:"Java 如何获取数组和字符串的长度?length 还是 length()?" 在逛 programcreek 的时候,我发现了上面这个 ...

  2. c# 判断字符是否是全角, 获取字符串的字节数 , 获取字符串指定长度字节数的字符串

    1 Encoding.Default.GetByteCount(checkString);  =2 全角 =1 半角 /// <summary> /// 获取字符串的字节长度 /// &l ...

  3. php查找字符串首次出现的位置 判断字符串是否在另一个字符串中

    strpos - 查找字符串首次出现的位置 说明 int strpos ( string $haystack , mixed $needle [, int $offset = 0 ] ) 返回 nee ...

  4. Oracle PLSQL Demo - 24.分隔字符串function

    -- refer: -- http://www.cnblogs.com/gnielee/archive/2009/09/09/1563154.html -- http://www.cnblogs.co ...

  5. Oracle PLSQL Demo - 31.执行动态SQL拿一个返回值

    DECLARE v_sql ) := ''; v_count NUMBER; BEGIN v_sql := v_sql || 'select count(1) from scott.emp t'; E ...

  6. Oracle PLSQL Demo - 29.01.Function结构模板 [无入参] [有返回]

    CREATE OR REPLACE FUNCTION function_name RETURN DATE AS v_date DATE; BEGIN ; dbms_output.put_line(v_ ...

  7. Oracle PLSQL Demo - 27.Declare & Run Sample

    declare v_sal ) :; begin --if you could not see the output in console, you should set output on firs ...

  8. Oracle PLSQL Demo - 20.弱类型REF游标[没有指定查询类型,也不指定返回类型]

    declare Type ref_cur_variable IS REF cursor; cur_variable ref_cur_variable; v_ename ); v_deptno ); v ...

  9. Oracle PLSQL Demo - 19.管道function[查询整表组成list管道返回]

    create or replace function function_demo RETURN emp PIPELINED as Type ref_cur_emp IS REF CURSOR RETU ...

随机推荐

  1. HDUOj Ignatius and the Princess III 题目1002

     母函数  组合数学 #include<stdio.h> int c1[125]; int c2[125]; int main() { int n,i,j,k; while(scanf ...

  2. Linux RAID简介

    现代磁盘的缺陷:IO性能极弱,稳定性极差 RAID廉价磁盘冗余阵列:通过多磁盘并行运行来提高计算机的IO性能,在创建RAID时要求硬盘大小.品牌.型号一样 RAID可分为多种,称之为RAID级别,现代 ...

  3. vue 常见报错问题

    情况一:http://eslint.org/docs/rules/no-tabs  Unexpected tab character 解决方案:缩进是4个空格,而不是tab,设置indent 情况二 ...

  4. NI License Activator 用法

    双击打开后,看到这种界面,将白色方格通过鼠标右击点绿就能够了. NI <wbr>License <wbr>Activator <wbr>用法 可能会出现这样的情况, ...

  5. HTTP 协议中的 Transfer-Encoding

    HTTP 协议中的 Transfer-Encoding 文章目录 Persistent Connection Content-Length Transfer-Encoding: chunked 本文作 ...

  6. git版本库管理介绍,撤销git pull操作

    Git是分布式版本控制系统,GitHub 是最大的 Git 版本库托管商,是成千上万的开发者和项目能够合作进行的中心. 大部分 Git 版本库都托管在 GitHub,很多开源项目使用 GitHub 实 ...

  7. .net连接MySQL的方法

    摘自:http://www.cnblogs.com/huayangmeng/archive/2011/04/06/2006866.html 最近要用C#做一个东西,连接之前项目的数据库(用MySQL建 ...

  8. ASP.NET 加入返回参数ReturnValue

    说明:很多时候,在DBHelper函数中,都能看到以下的代码: cmd.Parameters.Add(, ParameterDirection.ReturnValue, , , string.Empt ...

  9. HDUOJ---1879 继续畅通工程

    继续畅通工程 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Subm ...

  10. HDUOJ----1263水果

    水果 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submissi ...