With a Custom SQL adapter, no, but with a Dynamic SQL adapter, yes. With a Dynamic SQL adapter, you can pass as much or as little of the SQL statement in as input to the adapter service. You could even pass the entire SQL statement itself if so desired. A couple of things to be aware of:
-
A Dynamic SQL adapter will perform worse than a Custom SQL adapter because of the different Java objects that are used behind the scenes (Statement vs. PreparedStatement). The difference in performance is usually negligible.
-
A Dynamic SQL adapter can open the door to SQL injection attacks so you have to be extra careful with validating and managing your pipeline variables that are used to build the SQL statement.
In your particular case, because you only have two different scenarios, I would likely stick with two separate adapter services that use either the Custom SQL or Select SQL template. It avoids the two issues I mentioned above and I think it makes your services a little more readable.
Hope this helps,
Percio
#webMethods#Integration-Server-and-ESB