N queries in 1 Node mysql

Hello Everyone, I Have I have 4 queries connected to 1 node-red-contrib-stackhero-mysql , The queries is executed at the same time with an inject node , my question is how can i join them and make sure that i received the data of the 4 queries?

I don't have the stackhero mysql node but it may work in the same way as the more familiar node-red-node-mysql.

Set msg.tag on each query before feeding them to SQL.
This value is preserved through the SQL node so you can use it to join the 4 outputs into a single combined message.

[{"id":"40e414cd0c16085a","type":"tab","label":"Flow 2","disabled":false,"info":"","env":[]},{"id":"aeccf2df7499070a","type":"debug","z":"40e414cd0c16085a","name":"debug 293","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":710,"y":140,"wires":[]},{"id":"5b795a5e7be3568e","type":"mysql","z":"40e414cd0c16085a","mydb":"2381cb15.b563bc","name":"select","x":450,"y":140,"wires":[["da49e39e282d92ed"]]},{"id":"da49e39e282d92ed","type":"join","z":"40e414cd0c16085a","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"tag","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"4","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":570,"y":140,"wires":[["aeccf2df7499070a"]]},{"id":"bbfe7bbef5634f07","type":"change","z":"40e414cd0c16085a","name":"msg.tag=One","rules":[{"t":"set","p":"tag","pt":"msg","to":"One","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":280,"y":80,"wires":[["5b795a5e7be3568e"]]},{"id":"bcbe897d1eefd737","type":"change","z":"40e414cd0c16085a","name":"msg.tag=Two","rules":[{"t":"set","p":"tag","pt":"msg","to":"Two","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":280,"y":120,"wires":[["5b795a5e7be3568e"]]},{"id":"e9965f314711aced","type":"change","z":"40e414cd0c16085a","name":"msg.tag=Three","rules":[{"t":"set","p":"tag","pt":"msg","to":"Three","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":280,"y":160,"wires":[["5b795a5e7be3568e"]]},{"id":"16a90e4d41f1ccfe","type":"change","z":"40e414cd0c16085a","name":"msg.tag=Four","rules":[{"t":"set","p":"tag","pt":"msg","to":"Four","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":280,"y":200,"wires":[["5b795a5e7be3568e"]]},{"id":"2381cb15.b563bc","type":"MySQLdatabase","name":"db","host":"127.0.0.1","port":"3306","db":"espresso","tz":"","charset":"UTF8"}]
1 Like

That's what I need :smiley: , Thank you very much :smiley: :smiley:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.