一个示例存储过程
2005-03-06 15:15
417 查看
CREATE OR REPLACE procedure BM_ADD
(
p_ID varchar,
p_NAME varchar
)
is
--v_count number;
begin
/*
--检查输入参数是否为空
if p_id is null or p_name is null then
p_out:='输入的值为空!';
return;
end if;
--该用户名已经存在
select count(*) into v_count from bm a where upper(id)=upper(p_id);
if v_count>0 then
p_out:='该用户名已经存在';
return ;
end if;
*/
insert into bm (id,NAME) values (p_ID,p_NAME);
--commit;
--p_out:=null;
--return ;
/*
--插入过程中出现异常
exception
when others then
p_out:='插入过程中出现异常!';
return ;
*/
end;
(
p_ID varchar,
p_NAME varchar
)
is
--v_count number;
begin
/*
--检查输入参数是否为空
if p_id is null or p_name is null then
p_out:='输入的值为空!';
return;
end if;
--该用户名已经存在
select count(*) into v_count from bm a where upper(id)=upper(p_id);
if v_count>0 then
p_out:='该用户名已经存在';
return ;
end if;
*/
insert into bm (id,NAME) values (p_ID,p_NAME);
--commit;
--p_out:=null;
--return ;
/*
--插入过程中出现异常
exception
when others then
p_out:='插入过程中出现异常!';
return ;
*/
end;
相关文章推荐
- 一个在AS/400 DB2下的存储过程示例
- 一个简单的SQL游标示例的存储过程
- 创建一个输出参数为xml类型的存储过程(示例)
- 一个分页的类,分页的存储过程,分页的jsp示例
- 一个sql的存储过程的简单示例
- 一个分页的类,分页的存储过程,分页的jsp示例
- 用SQL语句生成某个库下所有存储过程脚本,并每个存为一个文件
- 在SQL Server中使用SQL语句查询一个存储过程被其它所有的存储过程引用的存储过程名
- 一个将数据导出到EXCEL的存储过程
- 利用存储过程把两个表的数据插入到一个新表中(存储过程中写两个游标)
- 请博客园的高手们帮忙看一个问题 为什么 set datefirst 1 写到存储过程中就不起作用了.
- 一个高效的分页存储过程
- 一个简单存储过程的性能分析
- 一个通用的分页存储过程
- SQL--触发器及存储过程示例
- 【老码农怀旧】一个简单好用的分页存储过程
- 连续编号的流水号拼接成一个字串的存储过程
- 一个分页查询的存储过程
- 一个基于ROW_NUMBER()的通用分页存储过程代码
- 一个简单的oracle分页存储过程的实现和调用