0

I am writing a trigger in mysql and my trigger is given below:

$sql="CREATE TRIGGER insert_cats AFTER INSERT ON tbl_categories
   FOR EACH ROW
   BEGIN
   insert into tbl_routes set fld_route_name='cat_' + //here i want to concatinate
   NEW.fld_name,fld_route_info='dynamic/route/info';
   end;
";

i want to concat string 'cat_' with New.fld_name. I tried CONCAT but i came to know it concatinates two columns and also tried + and . operator but nothing happen... Please help....

1 Answer 1

1

Use concat, it works with a literal and a column too :

concat('cat_', New.fld_name)
Sign up to request clarification or add additional context in comments.

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.