Skip to content

Instantly share code, notes, and snippets.

@imchao9
Last active January 23, 2016 15:36
Show Gist options
  • Save imchao9/5acd831eb18b236e3af0 to your computer and use it in GitHub Desktop.
Save imchao9/5acd831eb18b236e3af0 to your computer and use it in GitHub Desktop.
mysql procedure
DELIMITER ;;
CREATE DEFINER=`root`@`%` PROCEDURE `proc_update`(in type int,in start int,in end int)
begin
set @start=start;
set @end=end;
while @start<@end
do
update tbl_material set file_type = type where id = @start;
set @start=@start+1;
end while;
end;;
DELIMITER ;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment