Re: Issues with converting update command to trigger
I appreciate this community, thank you for this help. I am trying to watch table: telemetry_log for any insert. Upon any insert on telemetry_log i would like to update the column: device_desc of that newly inserted row with the device_desc from table: id_name_update based on matching device_ids.
Currently the command is running out of a bash script that uses the data remotely.
Here was my most recent attempt:
DROP IF EXISTS TRIGGER add_desc
DELIMITER $$
CREATE TRIGGER add_desc
AFTER insert on telemetry_log
FOR EACH ROW
BEGIN
UPDATE telemetry_log JOIN id_name_update ON telemetry_log.device_id = id_name_update.device_id
SET telemetry_log.device_desc = id_name_update.device_desc
WHERE telemetry_log.devie_desc IS NULL;
end;
$$
delimiter;
Subject
Views
Written By
Posted
1115
July 01, 2020 09:29AM
546
July 01, 2020 09:33AM
468
July 01, 2020 02:07PM
Re: Issues with converting update command to trigger
488
July 02, 2020 05:55AM
474
July 02, 2020 11:59AM
812
July 02, 2020 07:10PM
522
July 02, 2020 09:45PM
520
July 03, 2020 02:53AM
469
July 03, 2020 07:17AM
490
July 03, 2020 10:43AM
456
July 03, 2020 07:46PM
500
July 15, 2020 05:33AM
500
July 15, 2020 10:33AM
533
July 15, 2020 11:02AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.