Re: Filling in "gaps" in data

From: William Robertson <>
Date: Mon, 3 Nov 2008 23:27:01 -0800 (PST)
Message-ID: <>

On Nov 1, 12:56 am, Charles Hooper <> wrote:
> It is a bit interesting that a search of the Oracle documentation for
> "connect by level" returns 0 results.  A Metalink search for the same
> phrase only returns a couple hits, most of which report bugs.  I first
> saw the method of using connect by level used in this Usenet forum,
> and I recall having difficulty understanding why it worked

There is no special CONNECT BY LEVEL syntax, which is why this exact phrase is not documented. There is just "CONNECT BY [condition]". The documentation then links to "Conditions" ("A condition specifies a combination of one or more expressions and logical (Boolean) operators and returns a value of TRUE, FALSE, or UNKNOWN.") I personally prefer ROWNUM <= n, but it could be any condition you like that is true until you want it to be false, e.g.

SELECT ROWNUM FROM dual CONNECT BY DBMS_RANDOM.VALUE(0,1) > 0.5 Received on Tue Nov 04 2008 - 01:27:01 CST

Original text of this message