This is a classic case of asking for a solution to a solution, rather than a solution to a problem.
Please give us at least *some* clue as to the bigger picture here. Because this has all the signs of something that's likely to NOT make sense, or better done through other means. We could be wrong, of course, but the "this doesn't look good" part of my brain got triggered.