TPT Operator to load data from table to table

Database
Enthusiast

TPT Operator to load data from table to table

Hi,

 

Am new to TPT, with the help of my previous post now am able to import Mainframe file to Teradata stage table using Load_operator.

 

Now I need to load data  from stage table to target table using TPT.  I have seens most of the examples exporting the data from TD table and then loaded into target table using Load or inserter operator.

 

If we need to load the data from one TD table to another TD table using TPT means, we need to export the data into file and import the data into target table?

 

Like Mload or bteq, we cant directly insert the records from stage to target table? like below example

 

Insert into table_1

(

Col_1,

Col_2

)

select

Col_1,

Col_2

FROM TABLE_2

 

please help me..


Accepted Solutions
Teradata Employee

Re: TPT Operator to load data from table to table

Yes, you can. That's exactly how you would do it, using SQL in a batch BTEQ job, not TPT.  More commonly the MERGE SQL command is used to handle concurrent updates and inserts.  Even if you are only inserting (not updating the target table), Merge works as well or better thatn insert-select.

1 ACCEPTED SOLUTION
2 REPLIES
Teradata Employee

Re: TPT Operator to load data from table to table

Yes, you can. That's exactly how you would do it, using SQL in a batch BTEQ job, not TPT.  More commonly the MERGE SQL command is used to handle concurrent updates and inserts.  Even if you are only inserting (not updating the target table), Merge works as well or better thatn insert-select.

Apprentice

Re: TPT Operator to load data from table to table

Hi,

Although using BTEQ is valid you can certainly use TPT, just don't export/import the data. You've spotted that is usually a bad idea.

Use the TPT 'ddl operator' - this is nominally aimed at running ddl commands, but in fact will run any (certainly most) sql commands that do not return data. So an INSERT/SELECT or a MERGE fits the bill nicely.

Cheers,

Dave

 

Ward Analytics Ltd - information in motion
www: http://www.ward-analytics.com