updating newly created attribute data from back end for existing part numbers
What is the type of attribute that you want to update. If it’s a list/multi-list it is little complicated from back-end but for other types it should be easy. Also is it page_two/three attribute.
Again from sdk for any type of attributes it is straight forward. Lastly i executed for 2.5 lakhs rows and it took around 17 hrs to complete.
Can you share more details.
Preferred is writing simple standalone code as batch job and executing over the weekends when server load is minimal.
From SQL perspective i will take case of one particular part and try to outline the process:
1. List-Values are stored as integers in database so you need to know what is the code corresponding to your list-entry. Below query gives what is the corresponding entryid for your list-attribute values.
Select distinct(p2.list03),li.entryid, li.entryvalue from page_two p2, listentry li where p2.list03=li.entryid(+)
LIST03 ENTRYID ENTRYVALUE
219275 219275 No
219274 219274 Yes
2. Let’s consider we have a part XXX-XXXXXX where currently it is updated as Blank or No. So in order to update a given part number with say “Yes”
update page_two p2
where p2.id= (Select i.id from item i , page_two p2,listentry li where i.id=p2.id(+) and p2.list03=li.entryid and i.item_number=’XXX-XXXXXX’ and li.langid(+)=0)
3. Once you execute it, commit the operation. Logout/Login or refresh the object to see the updated value.
4. Also catch here is it doesn’t show in the history tab if the value is updated . So generally not a good practice since it doesn’t have tracking on attribute changes.
This i have tried and tested in lower environments and it works. So based on the above 1-3 approach you can do for all the data at once if it is one particular value or if you have list of what item should be updated to which list-value.
Hope it helps.
another way to update this attribute paga_two value is use the core Import functionality. There is no need to right any code, just download data from a search, update the data in a Excel Spreadsheet and import it.
It uses to be very straight forward process.