This makes no sense. In your first search you say ... col_a="foo" ... which means that there is only going to be events with values of foo for field col_a. You then do ... dedup col_a ... which means that you will only have a single event and that event will have a single value for col_a, namely foo. Then you are saying that you would like to parameterize a dbquery using these events but there is only one event so this optimizes down to simply this:
| dbquery "myotherdb" "select col_z from jimbobs.table where col_y='foo'"
So you should just do that (or clarify what you are really trying to do that doesn't oversimplify down to a trivial non-ish-answer).