Mysql数据操作

1:创建表

drop table if exists tb_App;

create table tb_App
(
   id                   int not null,
   name                 varchar(100) not null,
   typeId               int not null,
   introduction         text,
   advertising          varchar(200),
   LogoLink             varchar(200) not null,
   f_Id                 int not null,
   depth                int not null,
   cNum                 int not null,
   time                 datetime not null,
   oStatus              int not null,
   status               int not null,
   primary key (id)
);
alter table tb_App add constraint FK_Reference_1 foreign key (typeId)
     
 references tb_AppType (id) on delete restrict on update restrict;

 存储过程

drop procedure if exists sp_demo_out_parameter;
CREATE PROCEDURE
 sp_demo_out_parameter(OUT p_out INT) 
BEGIN 
        SET p_out=2;/*修改参数值*/ 
    SELECT p_out;/*看看有否变化*/
END; 

SET @p_out=1;
CALL sp_demo_out_parameter(@p_out);
drop procedure procww;


Delimiter 改变结束符合

posted on 2013-07-02 15:32  朝着  阅读(159)  评论(0编辑  收藏  举报