0

I'm trying to add a text string to certain columns. This is a query I've tried, it failed miserably though, but it explains what I want to do.

SET @NAME = (Select name from item_template where itemset = 801);
SET @NEWNAME = ('|cFFFF0000'+@NAME);
Update item_template set name = @NEWNAME where itemset = 801;

Thanks in advance! :)

3 Answers 3

1

Why not just

update item_template set name = concat('|cFFFF0000',name) where itemset = 801;
Sign up to request clarification or add additional context in comments.

Comments

0

try

Update item_template
set name = (select * from (select concat('|cFFFF0000', name) 
                           from item_template
                           where itemset = 801) x
           ) 
where itemset = 801;

or even shorter

Update item_template
set name = concat('|cFFFF0000', name) 
where itemset = 801;

Comments

0
SET @NEWNAME = ('|cFFFF0000'+@NAME);

use concat

SET @NEWNAME := CONCAT('|cFFFF0000',@NAME);

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.