1、我想在后台用存储返回数据集,在前台调用这个存储过程,应该怎么办?
cteate or replace procedure test as
select * from scott.emp where sal >800; 为何这个过程总是出错?返回数据集只能通过cursor,用循环的方法一条一条的读出来?有什么好方法?让前台能调用这个存储过程并看到返回的数据集?
cteate or replace procedure test as
select * from scott.emp where sal >800; 为何这个过程总是出错?返回数据集只能通过cursor,用循环的方法一条一条的读出来?有什么好方法?让前台能调用这个存储过程并看到返回的数据集?
as
type mycursor is ref curosr;
end;
/
cteate or replace procedure test(p_rc out test_age.mycursor)
as
begin
open p_rc for select * from scott.emp where sal >800;
end;
/
CREATE OR REPLACE PACKAGE PAC_Mycursor
AS
TYPE QUERY_CURSOR IS REF CURSOR;PROCEDURE My_cur_out(
An_area_id IN number,
An_serv_id IN number,
result1 out QUERY_CURSOR);
END PAC_Mycursor;CREATE OR REPLACE PACKAGE BODY PAC_Mycursor
AS
PROCEDURE My_cur_out(
An_area_id IN number,
An_serv_id IN number,
result1 out QUERY_CURSOR
)
AS
BEGIN
OPEN result1 FOR
SELECT SERV_ID, SERV_SEQ_NBR
from a
where area_id = An_area_id and serv_id > An_serv_id ;
END;END PAC_Mycursor;
begin
open for
select * from emp a where a.sal >800;
end;