标签:输出参数 word number 删除 select 存储过程 sele *** ber
create or replace procedure p002test
is
u_name varchar2(100);
begin
select user_name into u_name from t_user;
dbms_output.put_line(‘用户名为:‘||u_name);
end p002test;
create or replace procedure p002test
is
cursor u_cursor is select user_name, user_remark from t_user;
begin
for u_record in u_cursor loop
dbms_output.put_line(u_record.user_name||‘: ‘||u_record.user_remark);
end loop;
end p002test;
create or replace procedure p002test(p_user_id in number, p_user_password in varchar2)
is
begin
update t_user set user_password=p_user_password where user_id = p_user_id;
commit;
exception
when others then
dbms_output.put_line(‘修改失败,回滚。‘);
rollback;
end p002test;
create or replace procedure p002test(p_user_id in number, p_user_password in varchar2)
is
begin
update t_user set user_password=p_user_password where user_id = p_user_id;
commit;
exception
when others then
dbms_output.put_line(‘修改失败,回滚。errorCode:‘ || sqlcode || ‘ errorText:‘ || substr(sqlerrm,1,200));
rollback;
end p002test;
1.
begin
p002test();
end;
2.
call p002test();
call p002test(1, ‘123‘);
drop procedure 存储过程名字;
标签:输出参数 word number 删除 select 存储过程 sele *** ber
原文地址:https://www.cnblogs.com/moly/p/9702366.html