条件:
1.Java代码调用的时候有一下几个参数:
String []vestAreaName,String problemTypeName,StringproductionTypeName,String samTime,String[]handleDept,
String []sheetTime2.查询数据的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 <= 10end;
3.在存储过程中要将查询出来的值插入到另外一张表TBL_MAIN_SHEET_SAMPLING中
···················解决问题的大哥,100全给。
1.Java代码调用的时候有一下几个参数:
String []vestAreaName,String problemTypeName,StringproductionTypeName,String samTime,String[]handleDept,
String []sheetTime2.查询数据的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 <= 10end;
3.在存储过程中要将查询出来的值插入到另外一张表TBL_MAIN_SHEET_SAMPLING中
···················解决问题的大哥,100全给。
解决方案 »
- 急需解决
- struts1和struts2
- JAVA如何计算按钮被按下的时间???
- 求教一个sql查询语句
- 菜鸟呼叫高手!请教Web Services的分布式创建和引用的问题?急!!!!!
- Ejb问题
- 一个JSF+Hibernate的不知明问题````````````
- spring+hibernate3.x如何实现写入和读出oracle的blob字段?
- Struts中<html:form>中包含<logic:iterate>,提交多个checkId问题(表单一次删除多个选项)
- 关于Stub的问题
- 关于SQL在数据库正常运行但程序中调用出错问题。求解决。。。。。!
- Hibernate生成的DAO的问题
pl/sql存储过程的in变量就oracle那么几个类型
所以string数组要先转化成oracle认识的,你自己可以定格式
其他的cursor exe_immadiatexxx
查查资料就会写了
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]') ORDER BY dbms_random.value)
WHERE rownum <= 10
会报错,而且这条SQL语句就是Hibernate中打印出来的,可以在数据库中查询并且插入,就是通过程序调用报错,没有办法解决,所以寻求存储过程的思路,