Tenho a seguinte function:
create or replace function fteste(xx in varchar2) return sys_refcursor is
rc sys_refcursor;
begin
open rc for select id_paciente,nome from pacientes where nome like '%'|| xx ||'%';
return rc;
end;
select * from table(fteste('TESTE'))
Se executo a query da forma:
select fteste('TESTE') from dual
O que estou fazendo de errado?
Eu quero simplesmente retornar essa function com linhas e colunas, como uma tabela.
Desde já agradeço,
Romilson Alves