I am making a daily import script. It collects data from various sources and dumps it into a CSV. The CSV is used to make an external table and that external table is used populate the main table, with new data.
The trouble is that the schema of external table is designed to adapt the collected data. That is if there is a new column for the collected data, the generated external table will have that.
But the same is not true for transferring the data from external table to main table. For that I was wondering if there is some in-built function or maybe some procedure can be designed to do that.
Something like when the procedure is executed, it compares the schema of both the tables and add a column to the main table if the column is not present and then proceed with insertion of data.
Is something like this doable?