根据时间差修改状态
CREATE OR REPLACE PROCEDURE CHANGE_PRESC_VALID IS
BEGINUPDATE T_PRESC T SET T.VALID = 0 WHERE T.PRESC_STATUS IN (1,2)
AND TO_NUMBER(sysdate - to_date(T.PRESC_TIME,'yyyy-mm-dd hh24:mi:ss')) > 3;
COMMIT;
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE('Exception happened,data was rollback');
ROLLBACK;
END;