posts - 138, comments - 150, trackbacks - 0, articles - 1
  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理

mysql 数据库学习(触发器)

Posted on 2008-01-24 18:26 G_G 阅读(70) 评论(0)  编辑  收藏 所属分类: Database
 引用:http://bbs.mysql.cn/thread-9135-1-2.html
 引用:21. 触发程序

delimiter //
create trigger a_bi
before 
insert on a
for each row Begin
    
if new.s2=0 then
      
if(new.s3=1then
        
insert into b(s2) values(new.s1);
      elseif(new.s3
=2)then
        
insert into c(s2) values(new.s1);
      
end if;
    
end if;
    
end;//
delimiter ;




标题  
姓名  
主页
验证码 *  
内容(请不要发表任何与政治相关的内容)  
  登录  使用高级评论  新用户注册  返回页首  恢复上次提交      
该文被作者在 2008-01-29 15:57 编辑过