MySQL update procedure WITH multiple CASE and WHERE -


the query works , updates supposed to, when tried make stored procedure, fails "error near where". can see wrong please?

delimiter // drop procedure if exists update_trans_with_tags//  create procedure update_trans_with_tags() begin update transactions set trans_cat = case when trans_desc '%abc%' 1                 when trans_desc '%def%' 2                 when trans_desc '%ghi%' 4                 else trans_cat end; trans_cat null; end// delimiter ; 

take ; off of first end; ; still terminates statements within stored procedure. if hanging where didn't prevent saving procedure; "first" statement update all transactions.


Comments

Popular posts from this blog

Ansible warning on jinja2 braces on when -

Parsing a protocol message from Go by Java -

javascript - Replicate keyboard event with html button -