It is not straightfoward to see from the printscreens what you are doing where exactly. I’ll give some thoughts based on what I think is happening.
If {{request_URLPARAM0}} has a value within the .vsi, i.e. within the “Response Selection” step and this is due to magic stringing then that property request_URLPARAM0 will NOT exist in any step prior to the “Response Selection” step.
If you need to work with request_URLPARAM0 before the Response Selection step then you need to add a Request Data Copier DPH after your REST DPH and copy the arguments to “request_” properties.
Then in the scripted assertion: to my knowledge the script is not parsed before it is executed, so I don’t think that using {{request_URLPARAM0}} will work.
Within the script the property request_URLPARAM0 will exist and have a value if it exists in testExec. Wherever it is encountered as a variable the BeanShell will treat it as an existing variable. However, you are using it inside a fixed string and the characters {{request_URLPARAM0}} are just considered as part of a string.
It would do it as:
String query = “Select * from EmplyeeTest where EmployeeId = ‘” + request_URLPARAM0 + “’”;
testExec.setStateValue(“query”, query);
Cheers,
Danny