"in here I need to store the acc_id the matchs what was found in the db with the acount number from the @code_array array". I am searching for "2222987" and I find in the db 2222987 the id 66 is also found, that's what it means storing the value into this hash. But how to keep the original account number like TMW2222987 instead of 2222987 and the id of course. Thanks.