Itemdiscountable for all items in a Matrix

Dec 04, 2007 3 Replies

I want to run a script to change a particular matrix item's ITEMDISCOUNTABLE field. So far I have this much...



Update Item SET itemdiscountable='xxxx' WHERE itemlookupcode and I think I have to put ltrim or left or something in here so if my matrix items all start with 316464-161 (the whole codes being 316464-161-8,



316464-161-8.5, 316464-161-9 etc etc) then I will only change the items starting with 316464-161 in the lookupcode.

Hi Kris - you could try using the percent sign as a wildcard.... I don't think there is a field by the name of ITEMDISCOUNTABLE in the item table (I ran select itemdiscountable from item and got an error mssg re column not existing) - maybe you meant the ITEMNOTDISCOUNTABLE field? If so, you have two "on" "off" values - value 0 means "off", meaning item IS discountable at pos; value 1 means "on", meaning item IS NOT discountable at pos.

First run a test select query to make sure the items pulled in are the ones you want to affect by your update query select * from itemlookupcode where itemlookupcode like '316464-161%' (this will pull up all items that start with 316464-161 in the ILC field)

If you see the items that you want to set to NOT DISCOUNTABLE AT POS, then you're ready for your update query; **BACKUP YOUR DB FIRST**

update item set itemnotdiscountable = 1 where itemlookupcode like '316464-161%'

Remember to run the test select query and backup the database before runn> I want to run a script to change a particular matrix item's ITEMDISCOUNTABLE

Ran the test select query, got the following error...

An error occurred while executing query:

Invalid object name 'itemlookupcode'.

ITEMDISCOUNTABLE

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required