0

How do I select a function result with multiple rows from dual in PL/SQL?

SELECT multipleRowsFunction() AS multiple FROM dual;

or

BEGIN
  SELECT multipleRowsFunction() INTO multiple FROM dual;
END;

Are there any alternatives to DUAL for this purpose?

Matias
  • 37
  • 3
  • 11
  • Unsure of exactly what you want. Nevertheless, have a look at this question and see if it give you any clues: http://stackoverflow.com/questions/101033/how-to-return-multiple-rows-from-the-stored-procedure-oracle-pl-sql. Note it's asking a different question but the answers seem to relate to the part of the question that you're interested in. – wmorrison365 Apr 25 '17 at 08:29

1 Answers1

1

Depending on your function, your best bet is

select * from table(multipleRowsFunction);

In a PL/SQL block, you do not need select ... from dual; just write

begin
  multiple := multipleRowsFunction;
end;
Erich Kitzmueller
  • 36,381
  • 5
  • 80
  • 102