oracle根据分隔符将字符串分割成数组函数
--创建表类型
create or replace type mytype as table of number;
--如果定义成varchar
--CREATE OR REPLACE type mytype as table of varchar2(4000);
-- 将字符串分割成数组
function my_split(piv_str in varchar2, piv_delimiter in varchar2)
--piv_str 为字符串,piv_delimiter 为分隔符
return mytype is
j int := 0;
i int := 1;
len int := 0;
len1 int := 0;
str varchar2(4000);
my_split mytype := mytype();
begin
len := length(piv_str);
len1 := length(piv_delimiter);
while j < len loop
j := instr(piv_str, piv_delimiter, i);
if j = 0 then
j := len;
str := substr(piv_str, i);
my_split.extend;
my_split(my_split.count) := str;
if i >= len then
exit;
end if;
else
str := substr(piv_str, i, j - i);
i := j + len1;
my_split.extend;
my_split(my_split.count) := str;
end if;
end loop;
return my_split;
end my_split;
oracle根据分隔符将字符串分割成数组函数的更多相关文章
- shell 将字符串分割成数组
代码:test.sh #!/bin/bash a="one,two,three,four" #要将$a分割开,可以这样: OLD_IFS="$IFS" IFS= ...
- Linux shell 将字符串分割成数组
原文链接:http://1985wanggang.blog.163.com/blog/static/776383320121745626320/ a="one,two,three,four& ...
- [转+整理]linux shell 将字符串分割成数组
原文链接:http://1985wanggang.blog.163.com/blog/static/776383320121745626320/ a="one,two,three,four& ...
- sql server 将字符串分割成表函数 strsplitetotable
在sql server里,调用存储过程时,经常需要将数据拼成字符串做为参数调用存储过程,而在储存过程中分割字符串虽然简单但麻烦,封装了该函数,可以将拼串分割成内存表返回,方便使用,返回的表字段从a,b ...
- 字符串---分割成数组(str_split ),算出一个字符串中出现最多的字符, 学校中最多的姓名
split 分割separate分开 little 小的 echo '<meta http-equiv="Content-type" content="text/h ...
- php把字符串指定字符分割成数组
<?php $str="1|2|3|4|5|"; $var=explode("|",$str); print_r($var); ?> $var=ex ...
- 随笔 JS 字符串 分割成字符串数组 并动态添加到指定ID的DOM 里
JS /* * 字符串 分割成字符串数组 并动态添加到指定ID的DOM 里 * @id 要插入到DOM元素的ID * * 输入值为图片URL 字符串 * */ function addImages(i ...
- js 字符串分割成字符串数组 遍历数组插入指定DOM里 原生JS效果
使用的TP3.2 JS字符串分割成字符串数组 var images='{$content.pictureurl} ' ;结构是这样 attachment/picture/uploadify/20141 ...
- split 将字符串分割成字符串数组
list_name = list_name.split(","); split() 方法用于把一个字符串分割成字符串数组. 语法 stringObject.split(separa ...
随机推荐
- linux权限管理_文件特殊权限
一.SetUID功能 设定SetUID的方法 4代表SUID s代表SUID权限 S代表报错了,原因没有执行权限 # chmod 4755 文件名(最好用这种方法) # chmod u+s 文件名 取 ...
- springMvc源码学习之:spring源码总结
转载自:http://www.cnblogs.com/davidwang456/p/4213652.html spring beans下面有如下源文件包: org.springframework.be ...
- IIS-反向代理
测试环境:Windows10.IIS/10.0 1.安装ARR.URL Rewrite(URL重写工具2.0) 注意英文和中文环境的对应: Application Request Routing 对应 ...
- 转:RabbitMQ基础知识
RabbitMQ基础知识 一.背景 RabbitMQ是一个由erlang开发的AMQP(Advanced Message Queue )的开源实现.AMQP 的出现其实也是应了广大人民群众的需求,虽然 ...
- 观察者模式及Java实现例子
http://www.cnblogs.com/mengdd/archive/2013/02/07/2908929.html 观察者模式 观察者模式 Observer 观察者模式定义了一种一对多的依赖关 ...
- 一篇关于SpringMVC 传统文件上传的方法
一.界面效果 二.html代码 <legend>上传APK文件</legend> <form action="<%=basePath%>/apks/ ...
- 继承extends
class Person{ String name; int age; void eat(){ System.out.println("吃饭"); } void introduce ...
- 加快phpstorm、rubymine、pycharm系列IDE运行速度的方法
对jetbrains公司出品的IDE均有效,以rubymine为例: 打开C:\Program Files\JetBrains\RubyMine 6.3.3\bin,打开 rubymine.exe.v ...
- 112、两个Activity切换黑屏问题
<activity android:name=".main.select.ActDoyenActivity" android:screenOrientation=" ...
- (medium)LeetCode 278.First Bad Version
You are a product manager and currently leading a team to develop a new product. Unfortunately, the ...