Collapse AllExpand All

3.4.2. Pre and Post Processing

CSVimp gives you the added flexibility of being able to issue SQL commands both before and after your data import. Pre SQL statements are executed before an import begins, whereas post SQL statements are executed after the import has been completed.

The following screenshot shows a sample pre SQL statement where the pre SQL will delete all records from the import table to prevent duplicate records in the import:

CSV Atlas - Pre SQL

Note

Selecting the Continue load on errors checkbox will complete the import even if errors occur as a result of debugging problem files.

Post SQL statements are performed after the initial file has been imported into the specified table. In the next screenshot, we see an example of a post SQL statement associated with a data update action.

CSV Atlas - Post SQL

The statement shown in the example is responsible for making sure both the catalog items and the sellable items in xTuple are updated. The statement calls the function for the original import (xwd.importPricesvc) with the action to perform for that function ('U', indicating an update in the example).