Hello! I manage Kepware's Applications Engineering team and would be happy to field this question. Please note that you can reach my team directly by emailing us at presales.support@kepware.com.
With regard to your question, unfortunately we cannot use "dynamic" parameters like a tag name variable as "ID" in a Query table access method. As an aside, I have pushed for this feature quite often but so far we have not had enough external customer interest to add the feature.
Anyway, there are a couple of options:
1- Continue to use a Query table access method and hard-code the ID field in each query. NOTE that you can create up to 256 parallel Queries within a single instance of KEPServerEX, and we can support many hundreds more queries if you don't mind then run sequentially.
2- Switch to using a Stored Procedure access method, and you can do the following:
---> you would create an Input variable in your Stored Procedure to retrieve an ID field
---> you would use Output variables to combine / create the response value(s) that you're looking for; the Return variables (as you might know) are just for success or failure decimal values.
---> you might need to use our Advanced Tags plugin in order to automatically place values in Input variables and have the procedure automatically executed.
Here are a couple of webinars where I provide a detailed overview and example of functionality similar to what you're looking for:
Database Interaction:
https://www.youtube.com/watch?v=udHlrKSm8Rk&list=PLv3EViGH_uVkIWhdkjkf-SPpWnIlO_fmF&index=11&t=182s
Advanced Tags (probably less relevant):
https://www.youtube.com/watch?v=LtfaViH0W7k&list=PLv3EViGH_uVkIWhdkjkf-SPpWnIlO_fmF&index=16&t=2090s
It might best to discuss this via phone and/or remote support session; this is heavier engineering work that often requires engagement with my team. In other words, what you're looking to do - if I've understood correctly - is possible but it will take a combination of particular configuration of the ODBC Client driver and the use of QuoteAdvanced Tags.
Thanks, and look forward to hearing from you.
Sam