pipelined-function

Difference between Table Function and Pipelined Function?

浪子不回头ぞ 提交于 2019-11-28 12:21:56
CREATE OR REPLACE TYPE ty_1 AS OBJECT ( fn VARCHAR2(100), sl NUMBER, hd DATE ); CREATE OR REPLACE TYPE ty_1_table AS TABLE OF ty_1; CREATE OR REPLACE FUNCTION FN_RET_COL RETURN ty_1_table AS c ty_1_table := TY_1_TABLE(); BEGIN c.extend; C(1) := TY_1('A', 1, '10-JUN-2013'); c.extend; C(2) := TY_1('B', 2, '11-JUN-2013'); c.extend; C(3) := TY_1('C', 3, '12-JUN-2013'); RETURN c; END; CREATE OR REPLACE FUNCTION FN_RET_PIPE RETURN ty_1_table PIPELINED IS BEGIN PIPE ROW (TY_1('A', 1, '10-JUN-2013')); PIPE ROW (TY_1('B', 2, '11-JUN-2013')); PIPE ROW (TY_1('C', 3, '12-JUN-2013')); END; SELECT * FROM

Difference between Table Function and Pipelined Function?

£可爱£侵袭症+ 提交于 2019-11-27 06:59:04
问题 CREATE OR REPLACE TYPE ty_1 AS OBJECT ( fn VARCHAR2(100), sl NUMBER, hd DATE ); CREATE OR REPLACE TYPE ty_1_table AS TABLE OF ty_1; CREATE OR REPLACE FUNCTION FN_RET_COL RETURN ty_1_table AS c ty_1_table := TY_1_TABLE(); BEGIN c.extend; C(1) := TY_1('A', 1, '10-JUN-2013'); c.extend; C(2) := TY_1('B', 2, '11-JUN-2013'); c.extend; C(3) := TY_1('C', 3, '12-JUN-2013'); RETURN c; END; CREATE OR REPLACE FUNCTION FN_RET_PIPE RETURN ty_1_table PIPELINED IS BEGIN PIPE ROW (TY_1('A', 1, '10-JUN-2013'))