How to : Using Ruby filter, Perform db lookup while iterating the array

My jdbc_streaming produce an array like this

"attachment": [
	"departmentid" 	: "2"

now i would like to lookup my db using the departmentid, and get the equivalent department name and put it as below

"attachment": [
	"departmentid" 	: "2",
	"department" : [
           "department": "dept2"
           "other_details_here": ""

I can do this query if my attachment is flat,
Select departmentName as department from Department where id = :departmentid

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