Skip to Content
-1
Dec 17, 2018 at 07:00 AM

Select data from multiple tables using only one select query

306 Views

Hi All,

I am making a report where the user chooses the names of tables he wants to select data from. I have to fetch data from these tables and upload the data as flat files to application server.

When writing the report, 2 things are unknown : name and number of tables. As the internal table also depends on the table, the structure will be unknown too.

Is there a way in which I can only write one select statement and it can be reused.

Something like:

Select * from [table name] into table [internal table name of same format].

where I can update the table name and internal table (which should be of the same format as the table) .

Thanks,

Samriddhi