473,662 Members | 2,581 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

preventing CONNECT BY from generating an error if cycles exist

Hello;

I am wondering if anyone knows of a way to issue the CONNECT BY
clause on data that contains cycles? I have a business requirement
that specifies that cycles could be present in the data and cannot be
prevented. I want to use the CONNECT BY clause to prevent sending
massive IN clauses, but I cannot because CONNECT BY will generate an
error. Is there a similar clause that I can use besides CONNECT BY?

Any help would be appreciated.

Sincerely,

pa**@paulrowe.c om
Jul 19 '05 #1
1 3825
The problem is CONNECT BY is designed for tree walking tree data
structures, whereas the scenerio you describe is not a tree as it has
no finite path when traversed. Without Oracle's treewalk cycle checks
it wouldn't know when to stop, it could get caught in an infinite
loop.

I haven't tried this, but if you knew the id of the item which causes
the cycle on a given treewalk, you could do something like this :

select id, lpad(' ', 6*(level-1))||name
from mytable
start with parent_id is null
connect by parent_id = prior id and
id <> :StartOfCycleID

but you could have many IDs which cycle for a given treewalk
especially if you walk from root to leaf, and remember you can't use
sub queries or joins in treewalks to join to many StartOfCycleIDs .

Perhaps a StartOfCycleID could be determined from a PL/SQL function
which keeps track of the last id when doing a for rec loop, until the
cycle exception occurs?

It's a tough one!

Paul Scott

On 1 Aug 2003 08:44:11 -0700, pa**@paulrowe.c om (Paul Rowe) wrote:
Hello;

I am wondering if anyone knows of a way to issue the CONNECT BY
clause on data that contains cycles? I have a business requirement
that specifies that cycles could be present in the data and cannot be
prevented. I want to use the CONNECT BY clause to prevent sending
massive IN clauses, but I cannot because CONNECT BY will generate an
error. Is there a similar clause that I can use besides CONNECT BY?

Any help would be appreciated.

Sincerely,

pa**@paulrowe. com


Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

33
106508
by: Savas Ates | last post by:
in asp page im getting this error how can i solve it.. yesterday the codes work but i setup visual studio 6.0 now it doesnt works..
2
1539
by: bk | last post by:
This is driving me crazy. I get "SQL Server is unavailable or does not exist" error while developing asp.net application in vs2003's IDE development mode but when I install the application on the server the error disappears and everthing seems to be ok. The error does not appear when I connect to the same databse on the local sql2000 server. I use the same connection string for local WindowsXP+sql2000 server and the remote Windows 2003...
10
4501
by: et | last post by:
I have an asp.net program that uses a connection string, using integrated security to connect to a sql database. It runs fine on one server, but the other server gives me the error that "Login failed for user "NT AUTHORITY/ANONYMOUS LOGON". Why would this be? There is no reason it should even be trying to login to using NT Authority/Anonymous login. The IIS Server is set to turn off anonymous logins, and use integrated security, and my...
14
7027
by: Marcus | last post by:
I have a function that simply returns TRUE if it can connect to a particular Sql Server 2005 express, or FALSE if it cannot. I am getting some strange error codes returned when the computer that sql server resides on is not reachable. The error is different depending on the connection string that I use. If I use the following connection string: "server=192.1.1.1; Initial Catalog=master; uid=The_User; password=The_Password; Connect...
0
2608
by: Larry Rebich | last post by:
I am trying to use the sample web template that is distributed with Visual Studio 2005 called 'Personal Web Site Starter Kit'. After running for awhile it fails with the following message: ------------------------------------------ Server Error in '/PersonalWebSiteStarter' Application. -------------------------------------------------------------------------------- An error has occurred while establishing a connection to the server. ...
14
1768
by: Dave Rahardja | last post by:
Hi all, Is it possible to prevent _at compile or link time_ the mulitple instantiation of a templated function? In other words, if there exists a function template <typename Tvoid fn(); I want to prevent the user from doing this: int main()
3
2755
by: LamSoft | last post by:
I am not going to write a aspx to connect a SQL Server... but it tries to connect the SQL Server... Some of the Code.. protected void LoginButton_Click(object sender, EventArgs e) { if (Request.Form == null || Request.Form == "") { Session = "LocalHost"; }
1
1417
by: umamaheswarig | last post by:
Hi all, Am getting the following error. when extracting the data from sql server. -------------------------------------------------------------------------------------------------------- CLogReader::Open] SQL Server does not exist or access denied. Error (-2147467259): SQL Server does not exist or access denied.
1
162
by: Paul Rowe | last post by:
Hello; I am wondering if anyone knows of a way to issue the CONNECT BY clause on data that contains cycles? I have a business requirement that specifies that cycles could be present in the data and cannot be prevented. I want to use the CONNECT BY clause to prevent sending massive IN clauses, but I cannot because CONNECT BY will generate an error. Is there a similar clause that I can use besides CONNECT BY? Any help would be...
0
8432
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8344
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8857
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8546
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7367
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6186
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5654
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2762
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1993
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.