In case it helps you can get a list of your column names like this:
app_tables.my_table.list_columns()
So, if you need to iterate through column names, you could.
You could look at this post which shows how to search across multiple columns (the clone will allow you to see the code as well):
I have not read your question very carefully but I hope this helps to point you in the right direction.