oracle URL参数获取
改函数主要是从URL中获取参数例如 sssss.html?cur=aaa&ref=cccc
调用方式:f_querystr(url,'cur','&');
CREATE OR REPLACE FUNCTION f_querystr(in_str In Varchar2,in_key varchar2, in_separator In Varchar2)
RETURN varchar2
as
v_keyindex Number:=0;
v_sepindex number:=0;
v_str varchar2(4000);
begin
v_str:=in_str;
IF in_str IS NOT NULL
and in_key is not null
AND in_separator IS NOT NULL
and instr(v_str,in_key)<>0
THEN
if instr(v_str,in_key)<>0 then
v_keyindex:=instr(v_str,in_key)+length(in_key)+1; --KEY的长度加上等号的长度
end if; if in_key='cururl' then --特殊处理
if instr(v_str,'ref',v_keyindex-1)<>0 then
v_sepindex:=instr(v_str,'ref',v_keyindex-1)-1;
else
v_sepindex:=length(v_str)+1;
end if;
elsif in_key<>'ref' then --特殊处理
if instr(v_str,in_separator,v_keyindex-1)<>0 then
v_sepindex:=instr(v_str,in_separator,v_keyindex-1);
else
v_sepindex:=length(v_str)+1;
end if;
else
v_sepindex:=length(v_str)+1;
end if; if v_keyindex=v_sepindex then
return '';
else
if in_key='hot' then
v_str:=substr(v_str,v_keyindex,v_sepindex-v_keyindex);
v_sepindex:=instr(v_str,'_',1);
if v_sepindex>0 then
return substr(v_str,0,v_sepindex-1);
else
return v_str;
end if;
else
return substr(v_str,v_keyindex,v_sepindex-v_keyindex);
end if;
end if;
END IF;
return '';
end;
oracle URL参数获取的更多相关文章
- 字符串长度计算、截取、url参数获取、计算百分比、时间戳格式化
1.中英混合文字字符截取 //中文长度截取计算,可取中英混合,个数向上取整,精确度1个英文字符误差,一个英文算一个字符,一个汉字算一个字符. //sub("中文zlsd",1) - ...
- C#分析URL参数获取参数和值得对应列表
原文: C#分析URL参数获取参数和值得对应列表 /// <summary> /// 分析url链接,返回参数集合 /// </summary> /// <param n ...
- C#分析URL参数获取参数和值得对应列表(一)
C#操作Url参数 http://www.cnblogs.com/RobotH/archive/2008/11/17/1335322.html 用 C# 分析 URL 中的参数信息 http://ww ...
- post提交的数据有哪几种编码格式?能否通过URL参数获取用户账户密码
这里是修真院前端小课堂,每篇分享文从 [背景介绍][知识剖析][常见问题][解决方案][编码实战][扩展思考][更多讨论][参考文献] 八个方面深度解析前端知识/技能,本篇分享的是: [post提交的 ...
- PHP URL参数获取方式的四种例子
在已知URL参数的情况下,我们可以根据自身情况采用$_GET来获取相应的参数信息($_GET['name']);那,在未知情况下如何获取到URL上的参数信息呢? 第一种.利用$_SERVER内置数组变 ...
- 记录javascript 验证字符串布尔类型 及url 参数获取
/^true$/i.test("false");false/^true$/i.test("true");true //获取请求参数的值 function Req ...
- URL参数获取/转码
JS中对URL进行转码与解码 1.escape 和 unescape escape()不能直接用于URL编码,它的真正作用是返回一个字符的Unicode编码值. 采用unicode字符集对指定的字符串 ...
- C#分析URL参数获取参数和值得对应列表(二)
不错博客: [C#HttpHelper]官方产品发布与源码下载---苏飞版http://www.sufeinet.com/thread-3-1-1.html http://blog.csdn.net/ ...
- nodejs的url参数获取
express封装了多种http请求方式,我们主要使用get和post两种,即qpp.get和qpp.post.qpp.get和qpp.post的第一个参数都为请求的路径,第二个参数为处理请求的回调函 ...
随机推荐
- Ubuntu18.04 + cuda9.0+cudnn7.0
1 cannot find Toolkit in /usr/local/cuda-8.0 2017年05月27日 17:37:33 阅读数:2754 对于新版本ubuntukylin17.04安装C ...
- mxnet img2rec的使用,生成数据文件
建立文件夹 制作lst文件,即生成train.lst文件python im2rec.py ./mxrec/train ./mxdata --list --recursive train.lst文件格式 ...
- Kb,KB,Kbps,Mb,Mbps等一些列概念
先普及一下Kb,KB,Kbps,Mb,Mbps等一些列概念 1Byte = 8bit1KB (Kilobyte 千字节)=1024Byte1MB (Megabyte,兆字节,简称“兆”)=1024KB ...
- Android 耳机插入过程分析 (AudioManager部分)
接上一篇,记录audioManager对耳机插入的操作 https://www.cnblogs.com/helloworldtoyou/p/9868890.html 主要是发送广播,另外更新音频通路 ...
- 嵌入式驱动开发之内核态spi ---module_spi_driver
http://blog.csdn.net/dearsq/article/details/51839083 http://blog.csdn.net/alleincao/article/details/ ...
- Windows10锁屏壁纸提取
CMD执行: %localappdata%\Packages\Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy\LocalState\As ...
- 推荐个office能在线预览的插件
1.chrome office viewer 这个可以离线使用 2.微软 office web app 可以使用微软在线服务器或则自己搭建服务器 有兴趣的朋友百度一下具体操作方法
- 面向切面编程(AOP)简介
在软件中,有些行为对于大多数应用都是通用的.日志,安全和事务管理几乎是所有软件都需要的.他们是否可以主动的参与呢,如果让应用程序只关注与自己所针对的业务领域问题,而其他的问题有其他应用对象来处理.是否 ...
- Yii2 session的使用方法(1)
yii2打开session use yii\web\Session; $session = Yii::$app->session; // check if a session is alread ...
- HttpURLConnection如何添加请求头?
1.conn.setRequestProPerty(name,value),两个参数都是字符串.... 2.用httpURLConnection的setRequestProPerty(name,val ...