Quantcast
Channel: PL/SQL – Jeff Kemp on Oracle
Viewing all articles
Browse latest Browse all 30

Infinite Query

$
0
0

This is the query that never ends,
It just goes on and on, my friends.
Some people started fetching not knowing what it was,
And now they can’t stop fetching forever just because…

This is the query that never ends,

CREATE TYPE number_table_type IS TABLE OF NUMBER;

CREATE FUNCTION row_generator
RETURN number_table_type
PIPELINED IS
BEGIN
  LOOP
    FOR i IN 1..100 LOOP
      PIPE ROW (i);
    END LOOP;
  END LOOP;
  RETURN;
END;

SELECT * FROM TABLE(row_generator);

…inspired by…


Filed under: SQL Tagged: humour, PL/SQL, SQL, the-feuerstein-challenge

Viewing all articles
Browse latest Browse all 30

Trending Articles