日期:2014-05-17  浏览次数:20861 次

oracel 基础知识
create or replace procedure proc_stu(sid number,age in out number)
is
begin
  update student set stuAge=stuAge+age where stuId=sid;
  select avg(stuAge) into age from student;
end proc_stu;
---
declare
    id number:=&id;
    age1 number:=&age1;--5
begin
  proc_stu(id,age1);
  dbms_output.put_line('平均年龄:'||age1);
end;
里面的in out不是很明白?

------解决方案--------------------
in out 表示参数可以向该过程中传递值,也可以将某个值传出去,简单点说就是此参数即时输入参也是输出参