Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Connect By Without Prior

661232Oct 13 2008 — edited Oct 16 2008
Hi,

In 2005, this link (AskTom) discussed connect by without prior and Tom Kyte said:
"I shall file a documentation bug to have the documentation updated to accurately reflect reality."
In 2007 11g was released and Oracle 11g doc states:
* In a hierarchical query, one expression in condition must be qualified with the PRIOR operator to refer to the parent row.

PRIOR is most commonly used when comparing column values with the equality operator. (The PRIOR keyword can be on either side of the operator.) PRIOR causes Oracle to use the value of the parent row in the column. Operators other than the equal sign (=) are theoretically possible in CONNECT BY clauses. However, the conditions created by these other operators can result in an infinite loop through the possible combinations. In this case Oracle detects the loop at run time and returns an error.
But connect by without prior is still allowed in 11g
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
PL/SQL Release 11.1.0.6.0 - Production
CORE 11.1.0.6.0 Production
TNS for Linux: Version 11.1.0.6.0 - Production
NLSRTL Version 11.1.0.6.0 - Production


select level lvl from dual connect by level <= 10

LVL
---
1
2
3
4
5
6
7
8
9
10
Does this mean that connect by without prior is now officially allowed?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 13 2008
Added on Oct 13 2008
10 comments
2,084 views