我是个新手 想创建个无参数的 为什么结束不了
create or replace procedure cview
begin
select nvl(a.n1,b.n1) as n1,nvl(a.n2,b.n2) as n2,n3,n4 from a full join b
.n1=b.n1 and a.n2=b.n2;
end;
;
end;
还有能不能告诉我 存储过程是怎么用的 创建完事的话 怎么调用 之类的
create or replace procedure cview
begin
select nvl(a.n1,b.n1) as n1,nvl(a.n2,b.n2) as n2,n3,n4 from a full join b
.n1=b.n1 and a.n2=b.n2;
end;
;
end;
还有能不能告诉我 存储过程是怎么用的 创建完事的话 怎么调用 之类的
(po_result out sys_refcursor)
is
begin
open po_result for
select nvl(a.n1,b.n1) as n1,nvl(a.n2,b.n2) as n2,n3,n4 from a full join b
.n1=b.n1 and a.n2=b.n2;
end; 你返回的是一个结果集。至于调用,要看你用什么调用它。
在其他子程序里,直接这样写:
procedure cview;
请教啦
SQL> create or replace procedure cview (po_result out sys_refcursor)
2 is
3 begin
4 open po_result for
5 select nvl(a.n1,b.n1) as n1,nvl(a.n2,b.n2) as n2,n3,n4 from a full join b
on a.n1=b.n1 and a.n2=b.n2;
6 end;
7
8
9
10 ;
11
(po_result out sys_refcursor)
is
begin
open po_result for
select nvl(a.n1,b.n1) as n1,nvl(a.n2,b.n2) as n2,n3,n4 from a full join b
.n1=b.n1 and a.n2=b.n2;
end;
/
最后来个/