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
What is clause in sql?
what are the performance and scalability characteristics of mysql? : Sql dba
how to create a new table by selecting rows from another table in mysql? : Sql dba
What is mutating trigger?
what is the stuff function and how does it differ from the replace function? : Sql dba
What are different categories of sql commands?
What is the difference between microsoft access and sql?
What is sql in java?
How do you update a value in sql?
Does sql backup shrink transaction log?
explain mysql aggregate functions. : Sql dba
Can we use view in stored procedure?
Is stored procedure faster than query?
What is the difference between subquery and correlated query?
Which table is left in join?