sql - Flexible Update Stored Procedure Mysql -
I'm looking for a flexible update archive process. I have created this one when I call it Splat Page (1, 'A', 'B', 'Sea'), then it works fine.
Do I always have to pass 5 parameters in this example?
Can I also do this
call spUpdatePage (1, 'a', 'c')
knows the process Is that just want to update the column names and details?
Create = 'local host' process' spUpdatePage '(IN' pKey 'INT (4), `name` in VARCHAR (255), IN` title' VARCHAR (255) ) Description in the description 'VARCHAR' (255), IN` keyword 'VARCHAR (255)) updated page SET name = COALESCE (name, name), title = COALESCE (title, title), description = COALESCE (description, description) Keyword = COALESCE (keyword, keyword) WHERE id = pKey
Always have 5 params passed in this example?
Can I do this also?
call spUpdatePage (1, 'a', 'c')
For your posted archive process, all of you 5 parameters must be passed. No, you can not just pass name
and details
(in your posted archive process). However, you can write a stored procedure that only updates names
and details
. In some way,
set DEFINER = 'root' @ localhost 'process' spUpdatePageNameTitle` (IN 'pKey' INT (4), 'name` in VARCHAR (255), IN` title' VARCHAR (255)) Update page SET name = COALESCE (name, name), title = COALESCE (title, title) WHERE id = pKey
Comments
Post a Comment