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 'mysqladmin' in mysql? : Sql dba
Is sqlite thread safe?
What is recursive join in sql?
what is the different between now() and current_date()? : Sql dba
How does a self join work?
What is the best partition size for windows 10?
Is sql a programming?
How do I write a sql query in pgadmin 4?
How do you break a loop in pl sql?
What are types of indexes in sql?
What is union and union all keyword in sql?
How do you write a complex sql query?
What is dbo in sql?
Is primary key always clustered index?
what is heap table? : Sql dba