通过merge方法实现的:
MERGE INTO IFEBASE.STYLE AS MT
USING (SELECT :scenario AS SCENARIO_ID, :style AS SHAPE FROM SYSIBM.DUAL) AS VT ON (MT.SCENARIO_ID = VT.SCENARIO_ID)
WHEN MATCHED THEN UPDATE SET
MT.SHAPE = VT.SHAPE
WHEN NOT MATCHED THEN
INSERT (SCENARIO_ID, SHAPE) VALUES (VT.SCENARIO_ID, VT.SHAPE)
时间: 2024-11-08 08:25:29