存储过程名:包括页面后台代码和触发器和数据库连接类都有了,并且经过测试完全正确。 ChannelSet_MoveUP(上移) CREATE procedure [dbo].[ChannelSet_MoveUP] @ChannelID INT as DECLARE @SortID int DECLARE @TempSortID INT DECLARE @TempID INT BEGIN TRAN SELECT @SortID=SortID from ChannelSet where Channe
本文实例讲述了MySQL实现创建存储过程并循环添加记录的方法。分享给大家供大家参考,具体如下:
先创建,然后调用:
-- 创建存储过程
DELIMITER;//
create procedure myproc()
begin
declare num int;
set num=1;
while num <= 24 do
insert into t_calendar_hour(hourlist) values(num);
set num=num+1;
end while;
commit;
e