Oracle 多参数查询语句
程序员文章站
2023-02-22 12:55:16
废话不多说了,直接给大家贴代码了,具体代码如下所示:
create or replace function f_get_param(
in_par...
废话不多说了,直接给大家贴代码了,具体代码如下所示:
create or replace function f_get_param( in_param in varchar2, in_flag in varchar2) return varchar2 is result varchar2(500); v_leng number; v_left number; v_right number; v_param varchar2(200); v_param1 varchar2(200); begion result := ''; v_param:=in_param; v_leng := length(v_param); v_left := instr(v_param,in_flag); if v_left > 0 then v_param1 := substr(v_param,v_left,v_leng - v_left +1) v_left := instr(v_param1,':') + 1; v_right := indtr(v_param1,'$'); result := substr(v_param1,v_left,v_right-v_left) end if; return(result); exception when others then return ''; end f_get_param; //数据库赋值格式 f_get_param(v_param,'materialtype:');//器件编码类型 //数据库展示 public string buildtoparams(listargs args) { string params = '$'; if(args != null) { if(!string.isnotempty(args.materailtype)) { params = params + 'materialtypes:' + args.materailtype + '$'; } } return params; } //oracle 数据库拓展-多选参数 select instr(',' || '1,2,3,21' || ',',',' || '1' || ',') from dual select * from table_name where instr(',' || list_id || ',',',' || id || ',') > 0 //oarcle 多条件','隔开查询 select distinct regexp_substr('我爱你','[^.]+',1,rownum) xyz_name from dual connect by rownum <= length('我爱你') - length(replace('我爱你',',')) + 1
以上所述是小编给大家介绍的oracle 多参数查询语句,希望对大家有所帮助
上一篇: 羊肉汤要煲多久才好喝