I actually tried that, and it gave me another instance of the same issue even when assigning the query results to the variable. Is there another way?

And how do you mean the table mappings?