There is much more code but I am trying to stay within the guidelines of my work rules.
I am trying to use a CASE statement like this:
INSERT INTO PRODUCTS
SELECT DISTINCT IM.EDPNO
, IM.ITEMNO
, IM.DESCRIPTION
, SUBSTRING(EX.REFITEMNO,6,20) AS UPC_CODE
, IM.VENDORNO
, CONCAT(VAR_STORE_URL,VAR_DETAIL_URL,RTRIM(IM.ITEMNO)) AS URL
SELECT CASE DIVISION WHEN 'C4' OR 'J3' THEN
,CONCAT(VAR_STORE_URL,VAR_IMAGE_URL,IM.EDPNO,'.jpg')
End AS IMAGE_URL;
Then I imagine I would follow it up with another Select Case where I would get the image from a Lookup table instead on concating.
needs to be
You are missing a comma after
URL, shouldn’t have the leadingSELECTas it is already in aSELECTstatement and you can’t have theORwhen using the simple form of theCASEexpression.