51代码网ORACLEMYSQLSQL SERVER其它数据库java/jspasp/asp.netC/C++/VC++APP应用其它语言服务器应用
您现在的位置: 51代码网 >> mysql >> 文章正文

MySql中的存储过程怎么写

更新时间:2012-1-3:  来源:51代码网

本人从未用过mysql数据库,
今日想实现在Mysql中创建一个存储过程,有参数,sql语句为2条insert语句,需要用到事务。
望各位大虾回复?

示例:
create procedure ff()  
begin  
declare exit handler for sqlexception rollback; 
start transaction;  
insert into ....;
insert into ....;
commit;  
end;

示例:
delimiter $$
create procedure ff()  
begin  
declare exit handler for sqlexception rollback;  
start transaction;  
insert into ....;
insert into ....;
commit;  
end;$$
delimiter ;

  • 上一篇文章:
  • 下一篇文章: 没有了
  • 赞助商链接
    推荐文章
  • 此栏目下没有推荐文章
  • {
    设为首页 | 加入收藏 | 友情链接 | 网站地图 | 联系站长 |