Load from Flat File and generate values

Database
Fan

Load from Flat File and generate values

Hi,

I want to import data from flat file to Teradata table. For Example
----------------------
Source Flat File Layout
----------------------
Input.txt
--------------
Code1
Desc1
Code2
Desc2

--------------------------
Target Table layout
------------------------
TestTable1
--------------
Id1
Id2
Code1
Desc1

Now there are couple of things here
1) Id1 will be generated (Something like max+1 from TestTable1)
2) Id2 is from some other table, say TestTable2

I think this is not feasible in mload but I am sure we can do in BTEQ. How is it possible in BTEQ? Basically we have to do lookup and generate max+1 value for a table. Your comments will be appreciated!!!