定义:
存储过程属于PL/SQL(Procedureal Language/SQL,过程化SQL语言)
语法:
Create [or replace] procedure proc_name [(para_name [in | out | in out] type [,…..])] is | as
声明部分 //in表示入参,out表示出参
begin
执行部分;
EXCEPTION
异常处理部分
end [proc_name];
举例一:
举例二:
create procedure bbbb(v_a in int ,v_a1 out char(20),v_a2 in out char(20))
is
begin
v_a1 := v_a || "hello";
v_a2 := "world";
end bbbb;
调用:
declare
v_a1 char;
v_a2 char;
begin
pron_name(2,v_a1,v_a2);
dbms_output.put_line(v_a1 || v_a2); //oracle里输出v_a1,v_a2的值
end;