- I use FLOAD to import data from flat files to a temporary datatable.
- Next, I want to transfer the data from the temporary table to my definitive table with BTEQ.
In the definitive table, I have a value (country name) which is repetitive, so I created a reference table (COUNTRY) where I will store the strings naming the countries.
What I want to do is to update my definitive table from the temporary table, but when the country name is not already in the COUNTRY table, insert it in that table and insert only the ID of the country from the COUNTRY table in the definitive table .
For example :
Data in the temporary table :
What I want in the COUNTRY table :
What I want in the definitive table (last column is the ID of the country from the COUNTRY table) :
Is there a simple way to achieve such inserting with BTEQ ? I am a newbie with BTEQ and I really don't know how to do that.