Permalink
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
InCommonTAP-Examples/Sources/HR/sentrifugo_server/trigger.sql
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
8 lines (4 sloc)
1.29 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DELIMITER ;; | |
CREATE TRIGGER after_insert_on_main_employees_summary AFTER INSERT ON main_employees_summary FOR EACH ROW BEGIN SET @message_id = (SELECT lib_mysqludf_amqp_sendjson('amqp://mysql:5ecr3t@mq', 'sor', 'sor_person', json_object('payload',json_object('sourceId',json_array(json_object('id',NEW.employeeId,'source','HR')),'name',json_array(json_object('givenName',NEW.firstname,'familyName',NEW.lastname)),'email',json_array(json_object('emailAddress',NEW.emailaddress,'emailType','primary')),'phone',json_array(json_object('phoneNumber',NEW.office_number,'phoneType','Work'),json_object('phoneNumber',NEW.contactnumber,'phoneType','Mobile')))))); END;; | |
CREATE TRIGGER after_update_on_main_employees_summary AFTER UPDATE ON main_employees_summary FOR EACH ROW BEGIN SET @message_id = (SELECT lib_mysqludf_amqp_sendjson('amqp://mysql:5ecr3t@mq', 'sor', 'sor_person', json_object('payload',json_object('sourceId',json_array(json_object('id',NEW.employeeId,'source','HR')),'name',json_array(json_object('givenName',NEW.firstname,'familyName',NEW.lastname)),'email',json_array(json_object('emailAddress',NEW.emailaddress,'emailType','primary')),'phone',json_array(json_object('phoneNumber',NEW.office_number,'phoneType','Work'),json_object('phoneNumber',NEW.contactnumber,'phoneType','Mobile')))))); END;; | |
DELIMITER ; |