Upsert function is processed even when Truncate is selected

[CR #587639] In spite of the Truncate option being selected, the target tables do not get cleared before the Pre-processing SQL code executes. Thus, the Upsert or Delete function is processed on a non-empty table, leading to errors.

Workaround: To clear and repopulate target table before processing Upsert or Delete functions, make sure Truncate is unselected, and perform clearing of the table in pre-SQL script.