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
Why do we need unique key in a table?
Does truncate free space?
Does a primary key have to be a number?
explain the options of myisamchk to improve the performance of a table. : Sql dba
how to start mysql server? : Sql dba
What is the difference between a database and a relational database?
What is meant by cursor in sql?
Explain two easy sql optimizations.
Which function is used to return remainder in a division operator in sql?
What is out parameter used for eventhough return statement can also be used in pl/sql?
What is a nested table in word?
what is the stuff function and how does it differ from the replace function? : Sql dba
how to calculate expressions with sql statements? : Sql dba
How do I get sql certification?
Why do we need a foreign key?