Can someone explain what I'm doing wrong here?? I use the expression editor when importing my products in Prestashop. I use it for category (but tested it on others) and this is what happens.
When I use IF function I get the result I expect. When I use an IF statement however I get Mysql errors.
WORKING -> IF([CSV_COL(8)]='DVD' ,CONCAT('OK'), CONCAT('NOK'))
NOT WORKING ->
IF([CSV_COL(8)]='DVD') THEN CONCAT('OK')
In my eyes, these are exactly the same things ?? Or am I missing something here??
When I use the second i get these errors:
Cannot evaluate expression "IF('DVDs'='DVD') THEN CONCAT('OK')
ELSE CONCAT...". Error: "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') THEN CONCAT('OK')
END IF' at line 1"
I don't want to use the IF function, I actually want to use the CASE statement, but got errors there, and then tried the IF ... same result ... no result ;-)
Anyone please :-)
Mar 18, 2013
You should try to use the following expression:
WHEN ([CSV_COL(8)]='DVD') THEN CONCAT('OK')
If you want to use a CASE function, than you should use WHEN operator.