日期:2014-05-16  浏览次数:20740 次

存储过程有点问题请大神帮忙看看
create or replace procedure proc_CLXX_List --查询

(

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

pzh_ in varchar2,--牌照号

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

endTime_ in date,--创建日期上限
) is sql_str varchar2(1000):= ' select * from o_hbbz_djb a where(:pzh_ is null or a.PZH like :pzh_) and (:beginTime_ is null or a.FFTIME > :beginTime_) and (:endTime_ is null or a.FFTIME < :endTime_) and rownum<=:500 end proc_client_List';



------解决方案--------------------
SQL code

create or replace procedure proc_CLXX_List(
pro_cursor out pkg_order.p_cursor,
pzh_ in varchar2,
beginTime_ in date,
endTime_ in date
)
is
sql_str varchar2(1000):= 'select * from o_hbbz_djb a where(:pzh_ is null or a.PZH like :pzh_) 
        and (:beginTime_ is null or a.FFTIME > :beginTime_) 
        and (:endTime_ is null or a.FFTIME < :endTime_) 
        and rownum<=500';
begin
    open pro_cursor for sql_str
        using pzh_,pzh_,beginTime_,beginTime_,endTime_,endTime_;
end;
/