求一个PL/SQL的存储过程
条件:
1.Java代码调用的时候有一下几个参数:
String []vestAreaName,String problemTypeName,StringproductionTypeName,String samTime,String[]handleDept,
String []sheetTime
2.查询数据的SQL语句:
SELECT *
FROM (SELECT t.main_sheet_flow_no,t.mobile_tele_no,'这里为数组vestAreaName的值','这里为samTime'FROM tbl_main_sheet t,tbl_departments m where t.main_status='22' and t.sheet_category_id in ('1','3')
and to_date(t.deal_time,'yyyy-mm-dd hh24:mi:ss') >= to_date('这里为数组sheetTime[0]','yyyy-mm-dd hh24:mi:ss')
and to_date(t.deal_time,'yyyy-mm-dd hh24:mi:ss') < (to_date('这里为数组sheetTime[1]','yyyy-mm-dd hh24:mi:ss')+10)
and t.handle_dept= m.department_id
and (t.handle_dept='handleDept数组[0]' or t.handle_dept='handleDept数组[1]' or t.handle_dept='handleDept数组[2]') 这里可能为两个 t.handle_dept 所以要判断
ORDER BY dbms_random.value)
WHERE rownum <= 10
end;
3.在存储过程中要将查询出来的值插入到另外一张表TBL_MAIN_SHEET_SAMPLING中
···················解决问题的大哥,100全给。