function return multiple rows?

Dúvidas, dicas e truques de SQL, Select, Update, Delete, cláusulas, operações com joins, Funções em SQLs, etc

Poston Wed, 01 Jun 2005 5:39 pm

I have to make a function that returns multiple rows (equal to a select) to create a report.

Someone have any examples or know where I can find it?
Location: Chapecó - SC

Poston Thu, 02 Jun 2005 9:53 am

Take a look at these 2 topics: viewtopic.php?t=231 viewtopic.php?t=31
Location: Portland, OR USA

Thomas F. G

Você já respondeu a dúvida de alguém hoje?

Poston Sat, 04 Jun 2005 8:11 am

I couldn't find a function that returns multiple rows, it's pretty simple.

I'm going to put it because it is simple and can be very useful and some cases.
I hope that helps someone else.

Code: Select all
CREATE OR REPLACE TYPE obj_rel_Tab_preco_row AS OBJECT (
preço      number(16,6), 
comissao   number(5,2) ,
preco_2    number(16,6)

CREATE OR REPLACE TYPE obj_rel_Tab_preco_table AS TABLE OF obj_rel_Tab_preco_row;

create or replace function F_REL_TABELA_PRECO
  RETURN obj_rel_tab_preco_table AS
  v_tab obj_rel_tab_preco_table := obj_rel_tab_preco_table();
      v_tab(v_tab.last) := obj_rel_tab_preco_row( 1, 1.2 ,2 );
      exit when <condicao de saida>
    end loop;
  end if;
  RETURN v_tab;
Location: Chapecó - SC

  • See also
    Last Post

    Return to SQL

    Who is online

    Users browsing this forum: carlynhos77 and 6 guests