You may be aware that recently Google checkout has come up with a new requirement for their data feeds. The feeds are required to include at least two of three unique product identifiers (see web page):
http://www.google.com/support/mercha...?answer=160161
In my case, I decided the easiest thing to do to meet these requirements (since my wholesaler does not provide data like UPCs ISBNs, etc.) was to use a combination of a MPN, (which can be made up by the store owner), and a Brand Name.
I HAD been assigning brand names where appropriate, but I had NOT been entering model numbers, hence I was faced with adding a model number to 595 products, a pretty daunting task manually, so I decided to go the sql statement/query route and try to affect the change I needed in all 595 records (tables) at one time.
Originally, I tried to add an autoincrementing field and update that to the products_model field, but I could not find a statement that would update it sequentially, so I wound up with the number "1" in that field. I finally came up with this solution that took all of .033 seconds to accomplish my goal.
Keeping in mind that the products_id field is the auto incrementing one ( only ONE autoincrementing field is allowed in any table), as the shopping cart software assigns a new id to each product created, I decided to simply use the product_id as my new Manufacturers Part Number (MPN) to satisfy the new Google data feed requirements. SO, I ran this simple query:
UPDATE zen_products
SET zen_products.products_model = zen_products.products_id
THAT gave me a products_model field with the same values as the products_id field. Next I wanted to append a text prefix to that number so it would look "more official". To accomplish that, I used:
UPDATE zen_products
SET zen_products.products_model = concat(' MPN-',zen_products.products_id)
I hope you find this information useful.