一:创建和修改一个过程

create or replace procedure xland_proc
(v_title in varchar2,v_int out number)
is
v_char varchar2(111);
begin
select labor.xland.state,title into v_int,v_char from labor.xland where title = v_title;
end xland_proc;


存储过程有两个参数
一个是输入参数
一个是输出参数
is后面begin前面
是过程的声明部分
如果返回一个记录集就要用到游标了

执行这个存储过程

declare
x number;
begin
xland_proc('xland',x);
dbms_output.put_line(to_char(x));
end;


输出结果0
可以这样调用存储过程
你的过程名(过程形参=>你的变量,过程形参=>你的变量)

二:删除一个存储过程

drop procedure xland_proc;

相关文章:

  • 2021-08-01
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-04
  • 2021-08-26
  • 2021-08-31
  • 2021-10-13
猜你喜欢
  • 2021-12-27
  • 2022-02-17
  • 2021-06-30
相关资源
相似解决方案