What are pipelined functions . illustrate by example

Showing Answers 1 - 1 of 1 Answers

Gupta

  • Aug 7th, 2006
 

A table function is a function that returns an entire set of rows, and can be queried directly from the within a SQL statement, as if it were true database table. Whereas pipeline function is similar, but returns the data as it is constructed rather than all at once.

e.g.

CREATE TYPE MyType AS OBJECT (
field1 Number,
field2 Varchar2(50);

CREATE TYPE MyTypeList AS TABLE OF MyType;

CREATE OR REPLACE FUNCTION PipelineMe
RETURN MytypeList PIPELINED AS V_MyType Mytype;
BEGIN
FOR V_count IN 1..20 LOOP
V_Mytype :=MyType (V_count, ' Row ' || V_count);
PIPE ROW (V_Mytype);
ENDLOOP;
RETURN;
END PipelineMe;

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions