How it works...

In our script, we have the following update condition:

UPDATE td_cookbook_nyse.mktprice SET open_share = :in_open_share WHERE symbol = :in_symbol and id=:in_id; 

Records in the file will be checked against the table in Teradata. We have only two matching records, which are tdc and Goog; their values will be updated in the table and the new values Appl and MSFT will be written to the table as new records as shown in figure:

Have you noticed the ? against Appl? This is because, in our raw file, we have kept this value as missing.

Get Teradata Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.