In general, to get the names of a table, you do have to
contact the database and ask for the names. And that means,
doing a query. Somehow, the information has to get to get
to you.... Unless of course you have the names by some other
means, or if you have cached them. But you do not speak of
such a thing, which means you got to make a query.