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 are the different type of normalization? : Sql dba
What is sql entity?
What is java sql connection?
How to take user input in pl sql?
What is minus?
Can triggers stop a dml statement from executing on a table?
What does the file extension accdb stand for?
What is scope and visibility in PL/SQL?
Can we use delete in merge statement?
What is meant by truncate in sql?
what is a scheduled jobs or what is a scheduled tasks? : Sql dba
Why sql query is slow?
explain about mysql and its features. : Sql dba
What is numeric function sql?
What is the largest value that can be stored in a byte data field?