问题描述
createorreplaceprocedureSQ_BIAO(StartTimeinvarchar2)ASbeginDELETEfromur_smmes.Rp_Acto;declareSW1NUMBER(8,2);SW2NUMBER(8,2);beginselectsum(a.slab_weight)intoSW1fromur_smmes.da_ccm1_slab_summaryawherea.heat_numberin(selectheatidfromur_smmes.da_bof_reportwhereto_date(to_char(time_stamp,'YYYY-MM-DD'),'YYYY-MM-DD')=to_date(StartTime,'YYYY-MM-DD')andoperatorid='1');selectsum(a.slab_weight)intoSW2fromur_smmes.da_ccm1_slab_summaryawherea.heat_numberin(selectheatidfromur_smmes.da_bof_reportwhereto_date(to_char(time_stamp,'YYYY-MM-DD'),'YYYY-MM-DD')>to_date('2007-09-01','YYYY-MM-DD')andto_date(to_char(time_stamp,'YYYY-MM-DD'),'YYYY-MM-DD')<to_date(StartTime,'YYYY-MM-DD')andoperatorid='1');insertintoRP_ACTO(dang_ri_jia,LEI_JI_JIA)VALUES(SW1,SW2);COMMIT;END;endSQ_BIAO;这是在ORACLE10G里面做的...我是查询它当日的数据后..在查询他的累计数据.是从1号到他的当日的累计数据..但是'2007-09-01'这个日期我做的是死的.我要把它做成活的.....怎么写啊????
解决方案
解决方案二:
用变量啊,加参数,