support listing tables from other operations

This enhancement allows for listing table names from other operations than select.