1. SQL Server statement:
-- Update upload point table data
Update id_master set oncall_id = tb_points.oncall_id,
Servername = tb_points.servername,
Siscode = tb_points.siscode,
Loc_id = tb_points.jzcode,
Unit = tb_points.unit,
Description = tb_points.pointname
From tb_points
Where id_master.servername = tb_points.servername and
Id_master.siscode = tb_points.siscode
-- Update switch quantity data
Update buffer_digi set ctr_value = tb_points.realvalue,
Value_time = tb_points.inputdate
From tb_points, id_master
Where buffer_digi.oncall_id = id_master.oncall_id and
Buffer_digi.trans_id = id_master.trans_id and
Buffer_digi.loc_id = id_master.loc_id and
Id_master.servername = tb_points.servername and
Id_master.siscode = tb_points.siscode
2. Writing in Oracle
-- Update unit information
Update tb_pointconfig a set (generatorid) =
(Select decode (B. "groupid", 1, 13, 2, 14) as JZ
From sssj B where a. uploadid = B. "ID" and A. factoryid = 9 and (B. "groupid" = 1 or B. "groupid" = 2 ))
-- Use the merge method to update data
Merge into tb_realtimedatavalue
Using tb_pointconfig B
On (A. FID = B. factoryid and A. uploadid = B. uploadid)
When matched then
Update set a. pointid = B. ID
Where a. FID = 13