Skip to content

Instantly share code, notes, and snippets.

DELIMITER $$
CREATE PROCEDURE sp_mass_payee_update (IN id_list JSON)
BEGIN
-- Declare variables and cursor for notification loop (must be before any SQL statements)
DECLARE done INT DEFAULT 0;
DECLARE cur_id BIGINT UNSIGNED;
DECLARE cur_xpayer_id BIGINT UNSIGNED;
DECLARE cur_notify_code INT;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = 1;
DECLARE cur CURSOR FOR
[alias]
gone = ! "git fetch -p && git for-each-ref --format '%(refname:short) %(upstream:track)' | awk '$2 == \"[gone]\" {print $1}' | xargs git branch -D"