oracle怎么做分页查询条件,Oracle多条件查询的分页存储如何操作?

以下的文章主要介绍的是Oracle多条件查询的分页存储实际操作过程,以下的文章主要是介绍一种更为快捷的方法来实现其实际操作过程,以下就是具体方案的描述,希望在你今后的学习中会有所帮助。

项目接近尾声了,感觉将业务逻辑放到Oracle中使得后台代码很精简,Oracle很有搞头!

PL\SQL:

create or replace procedure proc_client_List --客户Oracle多条件查询

(

pro_cursor out pkg_order.p_cursor, --查询结果集

characters_ in varchar2,--客户性质

states_ in varchar2,--客户状态

type_ in varchar2,--客户类型

calling_ in varchar2,--客户行业

name_ in varchar2,--客户名称

beginTime_ in date,--创建日期上限

endTime_ in date,--创建日期上限

area_ in number,--客户地区

clientsource_ in varchar2,--客户来源

importent_ in varchar2,--重要程度

start_row in number,--结果集起始行

end_row in number--结果集结束行

) is

sql_str varchar2(1000):=

'select * from

( select row_.*, rownum rownum_ from

(

select * from clientinfo c

where(:characters_ is null or c.characters like :characters_)

and (:states_ is null or c.states like :states_)

and (:type_ is null or c.type like :type_)

and (:calling_ is null or c.calling like :calling_)

and (:name_ is null or c.name like :name_)

and (:beginTime_ is null or c.createtime>:beginTime_)

and (:endTime_ is null or c.createtime<:endtime_>

and (:area_ is null orc.area=:area_)

and (:clientsource_ is null or c.clientsource like :clientsource_)

and (:importent_ is null or c.importent like :importent_)

) row_ where rownum<= :end_row

)

where rownum_>:start_row';

begin

open pro_cursor for sql_str using

characters_,'%'||characters_||'%',

states_,'%'||states_||'%',

type_,'%'||type_||'%',

calling_,'%'||calling_||'%',

name_,'%'||name_||'%',

beginTime_,beginTime_,

endTime_,endTime_,

area_,area_,

clientsource_,'%'||clientsource_||'%',

importent_,'%'||importent_||'%',

end_row,start_row;

end proc_client_List;

上述的相关内容就是对Oracle多条件查询的分页存储过程的描述,希望会给你带来一些帮助在此方面。

【编辑推荐】

【责任编辑:孙巧华 TEL:(010)68476606】

点赞 0

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值