running pipelined function executes things inside it twice

Running Toad for Oracle 12.10.0.18 agains Oracle Database 11g Release 11.2.0.4.0 - 64bit Production (but I’ve tried a few databases)

Steps to reproduce:

CREATE OR REPLACE TYPE “INTEGER_TABTYPE” AS TABLE OF INTEGER;

CREATE OR REPLACE FUNCTION pipe_test
RETURN integer_tabtype
PIPELINED
IS
BEGIN
DBMS_OUTPUT.put_line (TO_CHAR (SYSTIMESTAMP));
PIPE ROW (1);
RETURN;
END;

select * from table(pipe_test)

returns TWO lines of

16.08.2016 13.47.15,332000000 +02:00
16.08.2016 13.47.15,332000000 +02:00

I checked running the query in SQLPLUS without the same issue.

In SQL*Plus, if you have done a “SET SERVEROUTPUT ON”, I would expect two lines as well. One from your SELECT and one from the DBMS_OUTPUT.PUT_LINE. Toad just turns the SERVEROUTPUT on for you…

Let us know!

Rich

And if I had actually tried out your example, I would have seen what you mean. The DBMS_OUTPUT output is what’s duplicated…

NM…

Fixed in next beta.

Thanks :slight_smile: