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 a function in oracle pl sql?
Explain about various levels of constraint.
What are aggregate and scalar functions?
What is a pl/sql block?
What is sql profiler in oracle?
define data blocks ? : Sql dba
What is set serveroutput on?
How to use transactions efficiently : transact sql
Does sql use python?
Can we insert in sql function?
What is oracle sql developer?
Which software is used for pl sql programming?
Can we use pl sql in mysql?
how many triggers are allowed in mysql table? : Sql dba
how to include numeric values in sql statements? : Sql dba