您的位置:首页 > 其它

一个示例存储过程

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;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: