MySQL存储过程一
时间:2008-12-15 来源:hkebao
1.基本语法:
create procedure sp_name()
begin
………
end
begin
………
end
请注意了:这里的语句啊,是要有分号结束符号的哦!否则就会郁闷一上午的哦!
1.基本语法:call sp_name()
drop procedure sp_name//
2.条件语句
if 条件 then
statement
else
statement
end if;
statement
else
statement
end if;
3.循环语句
(1).while循环
[label:] WHILE expression DO
statements
END WHILE [label] ;
(2).loop循环
statements
END WHILE [label] ;
(2).loop循环
[label:] LOOP
statements
END LOOP [label];
(3).repeat until循环
[label:] REPEAT
statements
UNTIL expression
END REPEAT [label] ;
statements
END LOOP [label];
(3).repeat until循环
[label:] REPEAT
statements
UNTIL expression
END REPEAT [label] ;
相关阅读 更多 +