Using stored procedure to enrich customer record
Hi all,
I'm trying to figure out if there is a way to call a stored procedure by customer and store the output of the stored procedure into the workflow temp table and assign it as a targetData.
For example, we have a stored procedure on our sql server called GetCustomerName, with an input of the customerId. The output is the customerName. I have the code so far below, but I'm not sure how to proceed further, any help would be greatly appreciated!
var customers = xtk.queryDef.create(
<queryDef schema={vars.targetSchema} operation="select">
<select>
<node expr="@id" groupBy="1" />
</select>
</queryDef>
).ExecuteQuery();
for each (var customer in customers){
sqlExec(EXEC GetCustomerName @customerId);
};
Best
Jim Xue