Skip to content

Instantly share code, notes, and snippets.

@jhyland87
Created September 9, 2016 20:06
Show Gist options
  • Save jhyland87/9bcc7d8352de8cab33a13957d72f543e to your computer and use it in GitHub Desktop.
Save jhyland87/9bcc7d8352de8cab33a13957d72f543e to your computer and use it in GitHub Desktop.
If query provided was:
"UPDATE STOREITEM SET replenish_status = 'N' WHERE COMPANYID = '{col:A}!' AND STOREID = '{col:B}!' AND ITEMID IN ({range:F-*:,}) AND MANAGERID IN ({cols:C,E:,});"
Then it will iterate over each row in said spreadsheet, spitting out queries formatted like so:
UPDATE STOREITEM SET replenish_status = 'N' WHERE COMPANYID = '<Value of column A in current row>' AND STOREID = '<Value of column B in current row>' AND ITEMID IN (<Concatenated string of values from col F to the last col, joined by a comma>) AND MANAGERID IN (<Concatenated string of values in cols C and E>);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment