创建存储过程
create or replace procedure 存储过程名称
(
参数名1 in 参数类型,
参数名2 in 参数类型,
参数名 out 参数类型
)
as
begin
--处理方法-
end;
举例
create or replace procedure Proc_Test
(num_A in integer,num_B in integer,num_C out integer)
as
begin
num_C := num_A + num_B;
dbms_output.put_line('其它处理');
end;
调用
declare num_C integer;--如果存储过程有out 一定要定义好输出 不然会报错--
begin
Proc_Test(3,4,num_C);
dbms_output.put_line('输出结果:'|| num_C );-- dbms_output.put_line 类似print---
end;