I have to do a role that returns several rows (equal to a SELECT) to create a report.
Do you have any example or do you know where I can find it?
Funcao Return several lines?
- dr_gori
- Moderador
- Posts: 5024
- Joined: Mon, 03 May 2004 3:08 pm
- Location: Portland, OR USA
- Contact:
Thomas F. G
Você já respondeu a dúvida de alguém hoje?
https://glufke.net/oracle/search.php?search_id=unanswered
Você já respondeu a dúvida de alguém hoje?
https://glufke.net/oracle/search.php?search_id=unanswered
Take a look at these 2 topics:
http://en.glufke.net/oracle/viewtopic.php?t=231 http://en.glufke.net/oracle/viewtopic.php?t=31
http://en.glufke.net/oracle/viewtopic.php?t=231 http://en.glufke.net/oracle/viewtopic.php?t=31
I was able to find a function that returns several lines, it is very simple.
I will post it because it is simple and can be very useful and some cases.
I hope it helps more algem.
I will post it because it is simple and can be very useful and some cases.
I hope it helps more algem.
CREATE OR REPLACE TYPE obj_rel_Tab_preço_row AS OBJECT (
preço number(16,6),
comissao number(5,2) ,
preço_2 number(16,6)
);
/
CREATE OR REPLACE TYPE obj_rel_Tab_preço_table AS TABLE OF obj_rel_Tab_preço_row;
/
create or replace function F_REL_TABELA_preço
(
<parametros>
)
RETURN obj_rel_tab_preço_table AS
v_tab obj_rel_tab_preço_table := obj_rel_tab_preço_table();
BEGIN
--
loop
--
.
.
.
--
v_tab.extend;
v_tab(v_tab.last) := obj_rel_tab_preço_row( 1, 1.2 ,2 );
--
exit when <condicao de saida>
end loop;
end if;
--
RETURN v_tab;
--
end F_REL_TABELA_preço;
-
- Information
-
Who is online
Users browsing this forum: No registered users and 13 guests