Home > database >  Essentially a Merge statement executes without errors, some data is not inserted into the library
Essentially a Merge statement executes without errors, some data is not inserted into the library

Time:12-06

Urgent for your bosses!!!!!!

Essentially a version
Microsoft SQL Server 2014-12.0.2000.8 (X64) Feb 20th 2014 20:04:26 Copyright (c) Microsoft Corporation Enterprise Edition (64 - bit) on Windows NT 6.3 & lt; X64 & gt; : (Build 9600)

Development framework and version
3.1.0 & lt;/mybatis - plus. Version>
7.4.1. Jre8 & lt;/used. Version>
1.1.23 & lt;/druid. Version>
3.0.0 & lt;/springboot. Dynamic - the datasource. Version>

Execution of the statement:
USING the MERGE INTO etl_device_realtime_history AS t (VALUES
(# # {item. DeviceId}, {item. CatagoryId}, # {item. CollectTime}, # {item. Enname}, # {item. FixedTime},
# # {item dataValue}, {item. ExternalProducerId}, # {item. DeviceSource})

) AS s (
Device_id, catagory_id collect_time, enname, fixed_time data_value, external_producer_id, device_source
) ON t.d evice_id=s.d. evice_id AND t.e nname=s.e nname AND t.f ixed_time=s. ixed_time
The WHEN MATCHED THEN
UPDATE the SET
T.s imulation_value=https://bbs.csdn.net/topics/t.data_value,
T.i s_simulation=0,
T.d ata_value=https://bbs.csdn.net/topics/s.data_value,
T.u pdate_time=GETDATE ()
WHEN NOT MATCHED THEN
INSERT (
Device_id, catagory_id collect_time, enname, fixed_time data_value,
, create_time, update_time is_simulation external_producer_id, device_source
) VALUES (
Spyware doctor evice_id, s.c atagory_id, s.c ollect_time, s.e nname, s. ixed_time, s.d. ata_value,
GETDATE (), GETDATE (), 0, s.e xternal_producer_id, s.d. evice_source
);


The incoming parameters have a lot of article, including the following:
2011 (Integer), 13 (Integer), the 2020-12-05 12:59:59. 0 (Timestamp), AccumulatedFlow (String), the 2020-12-05 13:00:00. 0 (Timestamp), 30484672.00 (BigDecimal), HD76_10001_P1 (String), WWAUTO (String),


Results the following image (have to)
  • Related