Oracle PLSQL Demo - 22.查看字符串的长度[lengthb, length],判断字符串是否包含中文
--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],判断字符串是否包含中文的更多相关文章
- 灵魂拷问:Java如何获取数组和字符串的长度?length还是length()?
限时 1 秒钟给出答案,来来来,听我口令:"Java 如何获取数组和字符串的长度?length 还是 length()?" 在逛 programcreek 的时候,我发现了上面这个 ...
- c# 判断字符是否是全角, 获取字符串的字节数 , 获取字符串指定长度字节数的字符串
1 Encoding.Default.GetByteCount(checkString); =2 全角 =1 半角 /// <summary> /// 获取字符串的字节长度 /// &l ...
- php查找字符串首次出现的位置 判断字符串是否在另一个字符串中
strpos - 查找字符串首次出现的位置 说明 int strpos ( string $haystack , mixed $needle [, int $offset = 0 ] ) 返回 nee ...
- Oracle PLSQL Demo - 24.分隔字符串function
-- refer: -- http://www.cnblogs.com/gnielee/archive/2009/09/09/1563154.html -- http://www.cnblogs.co ...
- Oracle PLSQL Demo - 31.执行动态SQL拿一个返回值
DECLARE v_sql ) := ''; v_count NUMBER; BEGIN v_sql := v_sql || 'select count(1) from scott.emp t'; E ...
- Oracle PLSQL Demo - 29.01.Function结构模板 [无入参] [有返回]
CREATE OR REPLACE FUNCTION function_name RETURN DATE AS v_date DATE; BEGIN ; dbms_output.put_line(v_ ...
- 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 ...
- Oracle PLSQL Demo - 20.弱类型REF游标[没有指定查询类型,也不指定返回类型]
declare Type ref_cur_variable IS REF cursor; cur_variable ref_cur_variable; v_ename ); v_deptno ); v ...
- Oracle PLSQL Demo - 19.管道function[查询整表组成list管道返回]
create or replace function function_demo RETURN emp PIPELINED as Type ref_cur_emp IS REF CURSOR RETU ...
随机推荐
- Protobuf学习 - 入门(转)
从公司的项目源码中看到了这个东西,觉得挺好用的,写篇博客做下小总结.下面的操作以C++为编程语言,protoc的版本为libprotoc 3.2.0. 一.Protobuf? 1. 是什么? Goo ...
- hdu 4893 Wow! Such Sequence!(线段树)
题目链接:hdu 4983 Wow! Such Sequence! 题目大意:就是三种操作 1 k d, 改动k的为值添加d 2 l r, 查询l到r的区间和 3 l r. 间l到r区间上的所以数变成 ...
- java 复制Map对象(深拷贝与浅拷贝)
java 复制Map对象(深拷贝与浅拷贝) CreationTime--2018年6月4日10点00分 Author:Marydon 1.深拷贝与浅拷贝 浅拷贝:只复制对象的引用,两个引用仍然指向 ...
- linux 系统文件的特殊权限
文件权限与归属 Linux系统中的一切都是文件,但每个文件的类型不尽相同,并且Linux系统会用不同的符号来加以区分,常见的包括有 -:普通文件,d:目录文件,l:链接文件,b:块设备文件,c:字符设 ...
- 微信小程序-简易计算器
代码地址如下:http://www.demodashi.com/demo/14210.html 一.前期准备工作 软件环境:微信开发者工具 官方下载地址:https://mp.weixin.qq.co ...
- 【php】实现多个一维数组转换成二维循环数组
1.目的:将下面类型数组转换成模板循环打印二维数组 数组库一维数组: 模板要求循环二维数组: 2.代码: header("Content-type: text/html; charset=u ...
- 使用Dockerfile文件构建基于centOS系统的tomcat镜像
以下是Dockerfile的内容: #基础镜像 FROM centos #维护人员信息 MAINTAINER weigs "weigs1231@gmail.com" #设置工作目录 ...
- sudo: Cannot execute /usr/local/bin/zsh: No such file or directory 问题
参考:sudo: Cannot execute /usr/local/bin/zsh: No such file or directory 之前在美化Ubuntu的时候,下了个zsh,但是忘记改配置文 ...
- android直接读取项目中的sqlite数据库
最近项目中要实现android读取sqlite数据库文件,在这里先做一个英汉字典的例子.主要是输入英语到数据库中查询相应的汉语意思,将其答案输出.数据库采用sqlite3. 如图: 实现过程完全是按照 ...
- 工作总结 MVC 验证 [Required] 必填 与 string 小知识
例如 添加页面有个 title 字段 设置了 [Required] 不填的时候 设置 还是验证不通过 设置为 还是不通过 说明了 验证只与页面上传不传值有关 与在后台设不设置值 无关. ...