You are here:  » Product database delta


Product database delta

Submitted by pgalav on Mon, 2006-07-17 04:51 in

Has anyone attempted to modify the original script to be able to only update the modified products and add new products instead of deleting and adding all the products everytime the feed is updated?

Submitted by support on Mon, 2006-07-17 06:38

Hi,

I've never written datafeed scripts in this way because it's very inefficient from a coding perspective. The process is as follows:

1) UPDATE every record to set delete flag

2) For each record perform a SELECT on existing table

3) If not exists, INSERT new record ~ else ~

4) UPDATE that record to clear delete flag

5) Finally, DELETE from table where delete flag is still set

In comparison to the current method:

1) DELETE every record

2) For each record INSERT into table

It's certainly possible to do, but I would only recommend it if you have a reason for wanting to do this (such as preserving additional information that you may have added to the products table).

Cheers,
David.