Use the following procedure to correct errors recorded in the error table specified as errortname2:
-
Use the following Teradata SQL statement to retrieve all rows from the second error table:
SELECT * FROM errortname2 ORDER BY cname ;
where the following is true:
The BTEQ response is a list of the contents of the second error table, ordered by the values in the primary index column.Syntax Element Description cname Unique primary index for the table errortname2 Name of the second error table -
Use the following Teradata SQL statement to retrieve each row from the Teradata FastLoad table that has a primary index value identical to a row retrieved from the second error table:
SELECT * FROM tname WHERE cname = errorvalue
where the following is true:Syntax Element Description cname Index of the Teradata FastLoad table errorvalue Index value retrieved from the second error table tname Name of the Teradata FastLoad table -
Compare the rows selected from the error table with the rows selected from the Teradata FastLoad table and determine which is correct.
- If the row selected from the error table is correct, then use a Teradata SQL DELETE statement to delete the incorrect row from the Teradata FastLoad table, and an INSERT statement to insert the correct row.
- If the row selected from the Teradata FastLoad table is correct, then use a Teradata SQL DELETE statement to delete the corresponding row from the error table.
- Repeat Steps 2 and 3 until all rows in the error table are accounted for.
- Drop the errortname2 table from the Teradata Database after all errors have been resolved.