zoukankan      html  css  js  c++  java
  • 2014/7/24

    初学存储过程

    DELIMITER //  定义写存储过程中的结束符为 //

    创建存储过程1

                            create procedure proce_userinfo(in name varchar(10) ,int pwd varchar(10),out flag int)

                            begin

                           select power from user where Username=name and password=pwd into flag;

                           end //


    创建存储过程2:

                         create procedure proc_reg(in name varchar(10),in pwd varchar(10),out flag int)
                         begin
                         set @count=0;
                         select count(*) from users where username=name  into @count;
                         if @count>0 then

                         set flag=0;                
                         else
                         set flag=1;
                         insert into users(username,passwords)values (name,pwd);
                         end if;
                         end

     declare 仅仅是声明,set既声明又赋值



  • 相关阅读:
    设计模式-1-概要(c#版)
    UML图示说明
    阿里云SLB双机IIS多站点负载均衡部署笔记
    阿里云分布式关系数据库DRDS笔记
    一些小经验
    NOSQL场景梳理
    内核linux-3.4.2支持dm9000
    构建根文件系统
    u-boot-1.1.6移植之dm9000
    移植u-boot-1.1.6(原创)
  • 原文地址:https://www.cnblogs.com/gavanwanggw/p/6877775.html
Copyright © 2011-2022 走看看