BEGIN TRANSACTION;
DELETE FROM DW_RX_V.RX_FLL_FCT
WHERE rx_nbr = IN_RX_NBR
AND rx_fll_dte = CAST(IN_RX_FLL_DTE AS TIMESTAMP(6) FORMAT 'MMDDYYYY')
AND rfl_tie_brk_nbr = IN_RFL_TIE_BKR;
IF :ACTIVITY_COUNT = 0
THEN
ROLLBACK;
SIGNAL ERROR_HANDLER;
END IF;
DELETE from DW_RX_V.RX_FLL_DET
WHERE rx_nbr = IN_RX_NBR
AND rx_fll_dte = CAST(IN_RX_FLL_DTE AS TIMESTAMP(6) FORMAT 'MMDDYYYY')
AND rfl_tie_brk_nbr = IN_RFL_TIE_BKR;
IF :ACTIVITY_COUNT = 0
THEN
ROLLBACK;
SIGNAL ERROR_HANDLER;
END IF;
END TRANSACTION;
我刚刚尝试使用上面的存储过程块,在运行时,它仍然无法在失败时回滚事务。
Teradata真的有回滚吗?
所以我想要的是,每次在第二个DML语句中找不到记录,然后回滚从开头删除的所有内容。