Search
Tuesday, February 07, 2012    Login    Register   
 
 

Reach Forum

 
  Reach Forum  Reach Developme...  Reach Integrati...  Clearing the contents of a SQL table before inserting into i
Disabled Previous
 
Next Next
New Post 7/27/2007 9:43 AM
User is offline Zak
14 posts
No Ranking




Clearing the contents of a SQL table before inserting into i 

If for any reason you wish to clear the contents of a table before refreshing all the data, it can be performed in RIC via two write tasks. One is to delete all the data, the other is to insert (as normal).

The layout for the task would be

  • Read (or Translate) Task
    • Write Task (delete all data)
    • Write Task (insert data)


RIC will execute the Write tasks in order from top to bottom, deleting the contents of the table and then inserting the data.

Write Task (Delete all Data) map file
The PayloadIn of this map file has to match the PayloadOut of the Read or Translate Task. If this is not the same, the Write task will not be executed as RIC thinks the it's not valid as the payload is not the same.

Truncating the table will not work as it does not return a returncode. I found that you have to 'delete from <tablename>' to remove all rows from the current table. If you wish to only delete data which you are importing, then you could 'delete from <tablename> where <identifier>', and then repeat this map file for every element that you have.

 
Disabled Previous
 
Next Next
  Reach Forum  Reach Developme...  Reach Integrati...  Clearing the contents of a SQL table before inserting into i