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

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -