sqlplus 执行20个存储过程 为什么执行最后一个要耗用很长时间
declare Import_Date date;begin Import_date:=to_date('2011-04-01','YYYY-MM-DD'); sp_GetOCNResult_XH(Import_Date); commit;end;/declare Import_Date date;begin Import_date:=to_date('2011-05-01','YYYY-MM-DD'); sp_GetOCNResult_XH(Import_Date); commit;end;/declare Import_Date date;begin Import_date:=to_date('2011-06-01','YYYY-MM-DD'); sp_GetOCNResult_XH(Import_Date); commit;end;/declare Import_Date date;begin Import_date:=to_date('2011-07-01','YYYY-MM-DD'); sp_GetOCNResult_XH(Import_Date); commit;end;/declare Import_Date date;begin Import_date:=to_date('2011-08-01','YYYY-MM-DD'); sp_GetOCNResult_XH(Import_Date); commit;end;/declare Import_Date date;begin Import_date:=to_date('2011-09-01','YYYY-MM-DD'); sp_GetOCNResult_XH(Import_Date); commit;end;/declare Import_Date date;begin Import_date:=to_date('2011-10-01','YYYY-MM-DD'); sp_GetOCNResult_XH(Import_Date); commit;end;/declare Import_Date date;begin Import_date:=to_date('2011-11-01','YYYY-MM-DD'); sp_GetOCNResult_XH(Import_Date); commit;end;/declare Import_Date date;begin Import_date:=to_date('2011-12-01','YYYY-MM-DD'); sp_GetOCNResult_XH(Import_Date); commit;end;/declare Import_Date date;begin Import_date:=to_date('2012-01-01','YYYY-MM-DD'); sp_GetOCNResult_XH(Import_Date); commit;end;/declare Import_Date date;begin Import_date:=to_date('2012-02-01','YYYY-MM-DD'); sp_GetOCNResult_XH(Import_Date); commit;end;/declare Import_Date date;begin Import_date:=to_date('2012-03-01','YYYY-MM-DD'); sp_GetOCNResult_XH(Import_Date); commit;end;修改下lz的代码:begindeclare Import_Date int; commit; set Import_Date = 201104[code=SQL]
[解决办法]
修改下lz的代码:begindeclare Import_Date int; commit; set Import_Date = 201104 while Import_Date<20111201 loop sp_GetOCNResult_XH(Import_Date);---接收参数存储过程接收字符类型 set Import_Date = Import_Date+100; end loop; set Import_Date = 20120101 while Import_Date<20120301 loop sp_GetOCNResult_XH(Import_Date);---接收参数存储过程接收字符类型 set Import_Date = Import_Date+100; end loop;end;