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 jobs use sql?
what are numeric data types? : Sql dba
Is sql between inclusive?
Can we join same table in sql?
What is sql deadlock?
Which is better join or subquery?
What view means?
in oracle 10g sw after compiling procedure how to pass parameter values ,if we (v_empid out number)how to give empid after successful compilation program.This site exact suitable for 10g with respect to question & answer same format , im trying sql browser & sql command prompt using exec procedure name & respective parameters.
How delete a row in sql?
how many sql dml commands are supported by 'mysql'? : Sql dba
what are aggregate and scalar functions? : Sql dba
What is the difference between clustered and non-clustered index in sql?
what is a view? : Sql dba
What is pl/sql table? Why is it used?
define sql insert statement ? : Sql dba