Itemdiscountable for all items in a Matrix

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.
Reply to
Kris
Loading thread data ...

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

Reply to
convoluted

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

An error occurred while executing query:

Invalid object name 'itemlookupcode'.

Reply to
Kris

ITEMDISCOUNTABLE

Reply to
convoluted

BeanSmart website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.