首页 / ORACLE / oracle存储过程
oracle存储过程
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了oracle存储过程,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含1540字,纯文字阅读大概需要3分钟。
内容图文
![oracle存储过程](/upload/InfoBanner/zyjiaocheng/505/3a631bfde1d341b994c65edde7d664e6.jpg)
查错
show errors;
查已建成的存储过程
select * from user_source where name=‘TESTINFO‘ order by line; --存储过程名要大写
调用
exec testinfo;
--程序块中调用testinfo --set serverout on begin testinfo end;
/**存储过程参数过程包括:in 输入参数、out 输出参数、in out可被修改的输入参数,并作为输出参数**/
in
create or replace procedure testinfo(v_id in int,v_name in varchar2) is begin insert into info values(v_id,v_name,‘6000‘,‘中国’); commit; dbms_output.put_line(‘插入新记录成功‘); end;
--不按顺序传入参数,指定参数值 begin testinfo(v_name=>‘小米‘,v_lid=>‘210000‘); end; --按顺序传入参数 begin testinfo(210000‘’,‘小米‘); end; --混合传入参数 begin pro_insertDept(210000,v_name=>‘小米‘); end;
out
create or replace procedure testinfo(v_id in int,v_name out info.name%type) as begin select name into v_name from info where id=v_id; end;
declare testname info.name%type; begin testinfo(‘210000‘,testname) dbms_output.put_line(testname);
end;
in out
create or replace procedure square(num in out int) as begin num:=powre(num,2) end;
declare n_num int; n_number int; begin n_num:=5; n_number:=n_num; square(n_number); dbms_output.put_line(n_num||‘平方是‘||n_number); end;
oracle存储过程
标签:char 基本 code 插入 包括 输入 serve info 程序
本文系统来源:https://www.cnblogs.com/Soper/p/10340206.html
内容总结
以上是互联网集市为您收集整理的oracle存储过程全部内容,希望文章能够帮你解决oracle存储过程所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。