Oracle 存储过程 分解字符串
来源:互联网 发布:淘宝精品推荐女鞋 编辑:程序博客网 时间:2024/05/01 01:40
虽然在网上找到了,但是结果不是很满意,程序没有将最后一串字符取出,然后在程序基础上修改了一下:
create or replace procedure GG(out_name out varchar2, permIds in varchar2) is--permIds的格式 如:5,8,9,45,56,78 p_start number; --开始的指针,这个为依次增加的,记录","的个数 l_position1 number; --起始位置 l_position2 number; sub_string VARCHAR2(50); --每次得到的子串 l_lastPosition number;begin out_name := ''; p_start := 1; l_position1 := 1; l_lastPosition:= 0; loop l_position2 := instr(permIds, ',', 1, p_start); --l_position2 找到“,”的位置 exit when l_position2 = 0; /* l_position2 - l_position1 为截取长度*/ sub_string := substr(permIds, l_position1, l_position2 - l_position1); if (l_position2 != 0) then l_lastPosition := l_position2+1; --记录倒数第二次l_position2的位置,以方便求得最后一个权限 end if; l_position1 := l_position2 + 1; p_start := p_start + 1; end loop; --找出最后一个 if (l_lastPosition!= length(permIds)) then sub_string := substr(permIds, l_lastPosition, length(permIds)); end if;end GG;
- Oracle 存储过程 分解字符串
- oracle存储过程截取字符串
- oracle存储过程之切割字符串(一)
- oracle存储过程之切割字符串(二)
- oracle分隔字符串的存储过程
- Oracle存储过程中去掉重复字符串的函数
- oracle中用存储过程加密一段字符串(3des算法)
- oracle 使用存储过程分割字符串为数组
- Oracle存储过程总结(二、字符串处理相关函数)
- Oracle存储过程总结(二、字符串处理相关函数)
- Oracle存储过程总结(二、字符串处理相关函数)
- Oracle存储过程总结(二、字符串处理相关函数)
- Oracle存储过程总结(二、字符串处理相关函数)
- Oracle存储过程总结(二、字符串处理相关函数)
- Oracle存储过程总结(二、字符串处理相关函数)
- Oracle存储过程总结(二、字符串处理相关函数)
- oracle中使用存储过程解析xml字符串
- Oracle存储过程总结(二、字符串处理相关函数)
- ajax请求问题。
- 在Linux下安装多个版本的gcc
- 苹果开发者账号申请教程
- js 下拉框二级联
- x264-snapshot-20121119-2245 arm-linux移植问题
- Oracle 存储过程 分解字符串
- [转]VS2008找不到MFC90d.dll、msvcrt.dll错误
- Cmake使用指南
- 第一章 说些废话
- hdu1789
- DataSet DataTable DataReader DataAdapter之间的区别
- android Camera 架构简介
- 正确理解ThreadLocal
- j2ee