Thank you so much ALL for all of the help. I tried different ways of executesql and it works perfectly. Those include embedded a value into the string and I tried to pass a parameter value into the string. Both ways works.
Please suggest what I should do next regarding my learning of dynamic sql. I have some experienced with python, java and I use regex quite a bit. Could I embed a regeex expression into a query string and makes it search for all possible values ?
Thanks for all of the helps.
Du