存储过程带有参数(in,out)

创建

create or replace procedure userInfo(userName out varchar,userAge in int)

as

begin

dbms_output.put_line('age='||userAge);

select '木生火' into userName from dual;

end;

调用

declare

str_userName varchar(10);

int_userAge int:=118;

begin

userInfo(userName=>str_userName,userAge=>int_userAge);

dbms_output.put_line('name='||str_userName);

end;

注意,=>前面的变量为存储过程的形参且必须于存储过程中定义的一致,而=>后的参数为实际参数。

原文链接:Oracle入门精读87-Oracle存储过程的参数(in,out)

最后修改:2024 年 01 月 25 日
如果觉得我的文章对你有用,请随意赞赏