Search notes:

PL/SQL: PIPE ROW

The pipe row statement is used (and can only be used) in Pipelined functions to return a row to the selector.
pipe row(…) requires parantheses.
create type pipe_row_o as object (
  a number,
  b varchar2(10)
);
/

create type pipe_row_t as table of pipe_row_o;
/


create function pipe_rows return pipe_row_t pipelined is
begin

    pipe row(pipe_row_o(1, 'one'  ));
    pipe row(pipe_row_o(2, 'two'  ));
    pipe row(pipe_row_o(3, 'three'));
    pipe row(pipe_row_o(4, 'four' ));

end pipe_rows;
/


select * from table(pipe_rows);


drop function pipe_rows;

drop type pipe_row_t;
drop type pipe_row_o;  
Github repository Oracle-Patterns, path: /PL-SQL/statements/pipe_row/do.sql

See also

Do not confuse pipe row with dbms_pipe

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1759421479, '216.73.216.42', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/databases/Oracle/PL-SQL/statements/pipe-row/index(72): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78