Created
June 10, 2016 20:34
-
-
Save jhyland87/de11d4c7d8f2cd22deed26f6501ec969 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Construct query with first column as STOREID, and rest of the columns are inside an WHERE IN list | |
awk 'BEGIN{FS=",";OFS=",";}{gsub(/[[:blank:]]+/,","); storeid=$1; $1=""; print "UPDATE STOREITEM SET replenish_status = \"N\" WHERE COMPANYID = 1795 AND STOREID = "storeid" AND ITEMID IN ("substr($0, 2)");"}' file.csv | |
# Example Output Queries | |
# UPDATE STOREITEM SET replenish_status = 'N' WHERE COMPANYID = 1795 AND STOREID = 1749 AND ITEMID IN (118469,117677,118233,.....); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment