MERGE inside FOREACH