
Originally Posted by
mc12345678
Okay, so the short answer to this, that I can think of is to get familiar with SQL commands.
So there are number of ways to go about fixing the situation that I can think of. And yes, while I read all of the above, I can't say that I have a single magic code answer to provide, but I do have a suggested process:
1. First of all, find a way to identify what it is you want to keep/want to not worry about. I would think that a full download would make that determination easier. (These items are active, these are not, these I remember as having attributes (which you could download also), etc...) EP4 does not prevent pulling the data out of the database just because it doesn't have model numbers. Now... It is also possible to pull the product id (if it is not already included in the datadump) through the user defined field(s) of the EP4 configuration. just enter the field name that appears in the products table (Sorry for not going back to reference the table at this point, but its either product_id or products_id). This information will help when you run SQL queries later on all of the data.
2. Okay, so the next thing that could be done is to use the spreadsheet and formulas to generate a SQLl command for the product to be able to update the model number for those that do not have one to something completely unique that won't be able to clash with any other existing product. This could be a combination of things like date, time, row number, etc... So basically, for each item as you look down the list, try to identify a field that has data in every row, where that data is different in each row (ie. product_id) and use it as your WHERE portion of your SQL command. Or if necessary the combination of two or more fields as long as they are uniquely combined (no two rows have the same combination of data), and in the end would use an UPDATE type command. However, may want to test the operation with a SELECT command.
3. Once you have created all of your UPDATE commands, then you can copy and paste them into the Install SQLPatches field from the Admin Tools. And voila, every product will have a model number. Alternatively, you could do a single SQL that would do an update on all products that do not have a model number to have one assigned to it based on whatever data would make that model number unique from any other existing model#.
The last would probably be the easiest/quickest, but would need to know/understand the existing model assignment so that the provided statement would not create a duplication.
All depends on your level of experience/familiarity. Unfortunately, EP4 doesn't currently have a "magically" assign model numbers on export option (yet)...
Bookmarks