Upserting data using MLOAD

Assume a scenario where you need to update the existing records based on certain criteria conditions and non-updating records are inserted into the table. This update and insert combined in one SQL are called as UPSERT.

UPSERT is not an SQL command, but a loading technique where missing rows are inserted and existing records are updated.

TMPUP and MLOAD can both be used for this purpose.

In this recipe, we will create a sample table in the Teradata Database, and then we will update the existing records in the sample table and add new records if any. The MLOAD script will be used for this.

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.