BEGIN
FOR L_RECORD IN (select RECORD_ID,CURR_PERIOD,PERIOD_START_DATE,(sysdate- PERIOD_START_DATE) diffTime,(P.PERIOD_END_DAY-P.PERIOD_BEGIN_DAY) periodDiffDay from CPS_PATIENT_PATH_RECORD t1
inner join cps_treat_period p on p.Period_Id=t1.Curr_Period
where t1.path_state=1)
LOOP
IF (L_RECORD.DIFFTIME >=L_RECORD.periodDiffDay)
THEN
UPDATE CPS_PATIENT_PATH_RECORD
SET PERIOD_START_DATE=to_date(to_char(sysdate,'YYYY/MM/DD'),CURR_PERIOD =L_RECORD.CURR_PERIOD+1
WHERE RECORD_ID=L_RECORD.RECORD_ID;
END IF;
END LOOP;
END;
格式:
@H_403_6@ FOR record IN (SELECT)
@H_403_6@ LOOP
@H_403_6@ UPDATE T WHERE
@H_403_6@ END LOOP
总结
如果觉得编程之家网站内容还不错,欢迎将编程之家网站推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。