How to return more than one value from a function?

Answer Posted / mglbayar

We can use oracle pipelined function

FUNCTION f_serie_arithmetica (p_nr IN NUMBER)
RETURN ARRAY PIPELINED
IS
v_sum NUMBER;
BEGIN
v_sum := 0;
FOR i IN 1 .. p_nr
LOOP
v_sum := v_sum + i;
PIPE ROW (v_sum);
END LOOP;
RETURN;
END;

Usage:
select * from table(f_serie_arithmetica(23));

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how to drop an existing view in mysql? : Sql dba

784


what is the difference between inner and outer join? Explain with example. : Sql dba

719


what is schema? : Sql dba

734


Which tcp/ip port does sql server run on? How can it be changed? : Sql dba

649


Which normal form is best?

671






what is try_catch block in procedure

1383


how to enter binary numbers in sql statements? : Sql dba

694


How is sql used in oracle?

748


What is a column in a table?

760


Explain what is an index?

750


What is a procedure in pl sql?

771


what is not null constraint? : Sql dba

712


How do you update f as m and m as f from the below table testtable?

1454


Enlist the advantages of sql.

738


How do I create a sql database?

708