Hello Lewis,
The second code I had a typo actually I am passing 'POSITION_DETAIL','SECURITY' in the working code, the problem is you cant have a dynamic IN clause, you will have to use Dynamic SQL , I was avoiding to not to use it , but looks like there is no way out.