mysql/procedure/ target=_blank class=infotextkey>mysql存储过程和触发器的简单例子,供大家参考。
--delimiter //
--DROP procedure if EXISTS `test_sp1`;
--create procedure test_sp1(out p int, in q int)
-- begin
-- set p = q + 1 ;
-- insert into test values(13, p, p);
-- end
--DROP TRIGGER IF EXISTS test_trig;
DROP TRIGGER test_trig;
delimiter //
create TRIGGER test_trig
before insert on status1
for each row
begin
insert into status112 values(23,'aa','bb','dd');
end; //
delimiter ;