Mapping between JDBC operations

I am putting a SELECT operation and then an INSERT operation in my Flow. However, webMethods does not allow me to map the output from the SELECT to the input of the INSERT.

It seems to me that SELECT operation is treated as Multi output mode even though my select always returns only 1 row (using max, count…) while INSERT is treated as Single input.

In order to make mapping possible, I have to put the INSERT operation inside a loop (even though it will loop for once only), which makes my component very cumbersome.

Is there any way I can do mapping without the loop?

you can put a custom step in the middle which does the following:

out.insertinput = selectoutput[0];

with “insertinput” defined in your output and “selectoutput” defined in your input. Be sure to add a dimension to “selectoutput” (click on []). Now you can map the output of your select to the input of your insert.
You might want to add some code which checks if the input is not null or you could get some nasty run time exceptions.
Another tip is to put this code in a common operation because I can guarantee that you’ll use this code a lot.
Hope this helps.