MYSQL在命令行创建存储过程
2011-06-04 16:55
197 查看
如何在MYSQL命令行创建存储过程.
delimiter //
create procedure pr_add
(
a int,
b int
)
begin
declare c int;
if a is null then
set a = 0;
end if;
if b is null then
set b = 0;
end if;
set c = a + b;
select c as sum;
end;
//
调用
call pr_add(1,2)
//
一定加上"//"部分,否则要报错.
delimiter //
create procedure pr_add
(
a int,
b int
)
begin
declare c int;
if a is null then
set a = 0;
end if;
if b is null then
set b = 0;
end if;
set c = a + b;
select c as sum;
end;
//
调用
call pr_add(1,2)
//
一定加上"//"部分,否则要报错.
相关文章推荐
- mysql 命令行创建存储过程
- Python--MySql(主键的创建方式、存储引擎、存储过程、索引、pymsql)
- MySQL中创建存储过程时通过DEFINER和SQL SECURITY设置访问权限
- mysql创建存储过程
- Mysql之存储过程,动态创建表和数据库-,动态删除-yellowcong
- MySQL中创建存储过程
- iBatis调用存储过程以及MySQL创建存储过程
- mysql创建存储过程
- Mysql创建存储过程时,出现ERROR 1064 (42000):的原因的一种
- mysql创建存储过程(根据时间字段来更新数据)
- MySQL使用存储过程创建用户
- mysql 中创建存储过程
- Mysql 命令行创建用户 修改密码 权限控制 备份 恢复
- mysql 创建事件、存储过程
- MySQL 存储过程 创建 查看 调用 删除
- Mysql创建存储过程的简单实例
- mysql创建存储过程
- 命令行操作mysql,创建数据库,创建表
- 黑窗口中创建mysql存储过程时的问题
- mysql存储过程、函数和触发器的创建 [转]