in reply to unique data in dynamic hash

How do i maintain uniqueness for "$testcase" in the hash while generating this hash
That's obvious: you need to convolve the contraint of the unique foreign key index parameter; preferably using a FFT, or failing that, using a 15mm to 1/2" compression adaptor. Alternately, you might want to reformulate your question in such a way that someone other than you has a clue what you're asking...

Dave.