zimmer_04
July 6th, 2009, 03:02 PM
I'm writing a query for multiple tables that follow a certain naming convention. I'm wanting to know if there is a way to write a query that will hit all of these tables without actually writing in the names of each and every individual table.
For example, say the naming convention is ST_ERR* - where a couple of the tables are named ST_ERR_CODES or ST_ERR_NAMES. Is there a way to write a query that would hit all of these tables, and put the table name that each row of data came from? More specifically what I'm trying to do is: there is an error_flag and process_dt_tm field on each of these tables that i'm wanting to know how many times each error_flag occurs on each date (process_dt_tm) for each table.
For example, say the naming convention is ST_ERR* - where a couple of the tables are named ST_ERR_CODES or ST_ERR_NAMES. Is there a way to write a query that would hit all of these tables, and put the table name that each row of data came from? More specifically what I'm trying to do is: there is an error_flag and process_dt_tm field on each of these tables that i'm wanting to know how many times each error_flag occurs on each date (process_dt_tm) for each table.