Importing All Records Via a Reject Table |
Perhaps "Reject Table" in this strategy would be more appropriately termed "import table". It is a reject table in the sense that rejected records remain in it. The advantage of this strategy is that you import all data in one go. You do not need to rely on an external file halfway into the import task. You can also use constraints and status fields to process import records from the reject table in a controlled manner. One drawback of this strategy is that you require more database space. You are also likely to need more processing time. To import all records from an external file via a reject table:
INSERT INTO <application table>[(columns)] SELECT <all records> FROM <reject table> DELETE <all records> FROM <reject table> WHERE EXISTS <condition to check whether records are inserted in application table>
|