以下的文章主要是介绍Oracle多条件查询分页存储过程,以下就是Oracle多条件查询分页存储过程具体方案的描述,希望在你今后的学习中会有所帮助。将业务逻辑放到Oracle中使得后台代码很精简,Oracle很有搞头!
PL\SQL:
create or replace procedure proc_client_List –客户多条件查询
(
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_strvarchar2(1000):= 'select*from (selectrow_.*,rownumrownum_from ( select*fromclientinfoc where(:characters_isnullorc.characterslike:characters_) and(:states_isnullorc.stateslike:states_) and(:type_isnullorc.typelike:type_) and(:calling_isnullorc.callinglike:calling_) and(:name_isnullorc.namelike:name_) and(:beginTime_isnullorc.createtime>:beginTime_) and(:endTime_isnullorc.createtime<:endTime_) and(:area_isnullorc.area=:area_) and(:clientsource_isnullorc.clientsourcelike:clientsource_) and(:importent_isnullorc.importentlike:importent_) )row_whererownum<=:end_row ) whererownum_>:start_row'; begin openpro_cursorforsql_strusing characters_,'%'||characters_||'%', states_,'%'||states_||'%', type_,'%'||type_||'%', calling_,'%'||calling_||'%', name_,'%'||name_||'%', beginTime_,beginTime_, endTime_,endTime_, area_,area_, clientsource_,'%'||clientsource_||'%', importent_,'%'||importent_||'%', end_row,start_row; endproc_client_List;
相关文章
标签:Oracle