How to handle errors in Merge Into

Database
Enthusiast

How to handle errors in Merge Into

Hi,

Can anybody tell how we handle if any error happen during Merge Into? Like in Multiload we use Error tables.

Thanks,

Terankit

2 REPLIES
Enthusiast

Re: How to handle errors in Merge Into

Hi,

SOme more info:

Like in Multiload:

.BEGIN MLOAD                                   

  TABLES T1                   

    WORKTABLES  T2

    ERRORTABLES T_ET

                T_UV

    CHECKPOINT 1000000                         

    ERRLIMIT 10                                

    AMPCHECK ALL;                              

for any error we check the Errortables mentioned above.

Do we such an arrangement in Merge Into?

Thanks,

Terankit

Enthusiast

Re: How to handle errors in Merge Into

Teradata (12.0 and later ) MERGE INTO syntax supports error tables.  See the the topic "Logging MERGE Errors In an Error Table" in the SQL Data Manipulation Language volume in the Teradata user documentation set.  The CREATE ERROR TABLE statement must be executed to create the error table before executing the MERGE statement.