Oracle Хранимые процедуры
надо тип ref cursor объявить
можешь привести пример кода!
Тоха, ПРЕВЕД!
+1
create or repl package test_pack as
type ref_cursor is ref cursor;
procedure test(cur out ref_cursor);
end test_pack;
/
create or repl package body test_pack as
procedure test(cur out ref_cursor) is
begin
open cur for 'select * from dual';
end;
end test_pack;
/
если не устраивает базирование процедуры test в пакете - второй вариант:
create or repl package test_pack as
type ref_cursor is ref cursor;
end test_pack;
/
create or repl procedure test( cur out test_pack.ref_cursor ) as
begin
open cur for 'select * from dual';
end;
/
Оставить комментарий
mezherm69
Как объявить процедуру которая возвращает курсорделаю так:
procedure test(cur out ref cursor) is
begin
open cur for
select e.*
from filial e;
end;
выдает ошибку синтаксиса