473,795 Members | 2,911 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Weird behaviour with START WITH and CONNECT BY

Hi, I have a recursive table containing complex SGML documents.
The table has a primary key "objectref" ; to determine what object is
actually valid, I have the columns validtime and obsoletetime, which
tell me when the object becomes, as you expect, valid and obsolete.

I ran the following query, that is supposed to return me the structure
from a specific node (identified with objectref = 7754087) up to the
top parent.

SELECT
objectref,
objectname,
objectid,
parentobjectid,
validtime,
obsoletetime
FROM
Objectnew
WHERE
validtime <= SYSDATE AND
obsoletetime > SYSDATE
START WITH objectref = 7754087
CONNECT BY objectid = PRIOR parentobjectid
ORDER BY objectid DESC;
Now, if you look at the result,

OBJECTREF OBJECTNAME OBJECTID PARENTOBJECTID VALIDTIME OBSOLETET
---------- ---------- ---------- -------------- --------- ---------
7754087 CHAPTER 490772 19524 22-AUG-01 31-DEC-12
30990083 AMM 19524 19504 27-AUG-03 31-DEC-12
18300296 CRJ_AMM 19504 -1 11-APR-00 31-DEC-12
18300296 CRJ_AMM 19504 -1 11-APR-00 31-DEC-12
18300296 CRJ_AMM 19504 -1 11-APR-00 31-DEC-12
18300296 CRJ_AMM 19504 -1 11-APR-00 31-DEC-12
18300296 CRJ_AMM 19504 -1 11-APR-00 31-DEC-12
18300296 CRJ_AMM 19504 -1 11-APR-00 31-DEC-12
18300296 CRJ_AMM 19504 -1 11-APR-00 31-DEC-12
18300296 CRJ_AMM 19504 -1 11-APR-00 31-DEC-12
18300296 CRJ_AMM 19504 -1 11-APR-00 31-DEC-12
18300296 CRJ_AMM 19504 -1 11-APR-00 31-DEC-12
18300296 CRJ_AMM 19504 -1 11-APR-00 31-DEC-12
18300296 CRJ_AMM 19504 -1 11-APR-00 31-DEC-12
18300296 CRJ_AMM 19504 -1 11-APR-00 31-DEC-12
18300296 CRJ_AMM 19504 -1 11-APR-00 31-DEC-12
18300296 CRJ_AMM 19504 -1 11-APR-00 31-DEC-12

17 rows selected.

Can somebody explain me why I have 15 times the last row repeated (it
is the same, as identified by its primary key objectref), when I was
expecting to get it only once ?)
Bernard Drolet
Jul 19 '05 #1
1 1940
you have 15 records in your table where object_id of 19504 equals the
parentobject_id ...

What does parentobject_id of -1 mean in your system ?

Hey if you want unique try select distinct
"Bernard Drolet" <le****@yahoo.c a> wrote in message
news:ee******** *************** ***@posting.goo gle.com...
Hi, I have a recursive table containing complex SGML documents.
The table has a primary key "objectref" ; to determine what object is
actually valid, I have the columns validtime and obsoletetime, which
tell me when the object becomes, as you expect, valid and obsolete.

I ran the following query, that is supposed to return me the structure
from a specific node (identified with objectref = 7754087) up to the
top parent.

SELECT
objectref,
objectname,
objectid,
parentobjectid,
validtime,
obsoletetime
FROM
Objectnew
WHERE
validtime <= SYSDATE AND
obsoletetime > SYSDATE
START WITH objectref = 7754087
CONNECT BY objectid = PRIOR parentobjectid
ORDER BY objectid DESC;
Now, if you look at the result,

OBJECTREF OBJECTNAME OBJECTID PARENTOBJECTID VALIDTIME OBSOLETET
---------- ---------- ---------- -------------- --------- ---------
7754087 CHAPTER 490772 19524 22-AUG-01 31-DEC-12
30990083 AMM 19524 19504 27-AUG-03 31-DEC-12
18300296 CRJ_AMM 19504 -1 11-APR-00 31-DEC-12
18300296 CRJ_AMM 19504 -1 11-APR-00 31-DEC-12
18300296 CRJ_AMM 19504 -1 11-APR-00 31-DEC-12
18300296 CRJ_AMM 19504 -1 11-APR-00 31-DEC-12
18300296 CRJ_AMM 19504 -1 11-APR-00 31-DEC-12
18300296 CRJ_AMM 19504 -1 11-APR-00 31-DEC-12
18300296 CRJ_AMM 19504 -1 11-APR-00 31-DEC-12
18300296 CRJ_AMM 19504 -1 11-APR-00 31-DEC-12
18300296 CRJ_AMM 19504 -1 11-APR-00 31-DEC-12
18300296 CRJ_AMM 19504 -1 11-APR-00 31-DEC-12
18300296 CRJ_AMM 19504 -1 11-APR-00 31-DEC-12
18300296 CRJ_AMM 19504 -1 11-APR-00 31-DEC-12
18300296 CRJ_AMM 19504 -1 11-APR-00 31-DEC-12
18300296 CRJ_AMM 19504 -1 11-APR-00 31-DEC-12
18300296 CRJ_AMM 19504 -1 11-APR-00 31-DEC-12

17 rows selected.

Can somebody explain me why I have 15 times the last row repeated (it
is the same, as identified by its primary key objectref), when I was
expecting to get it only once ?)
Bernard Drolet

Jul 19 '05 #2

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

Similar topics

2
1469
by: Freddie | last post by:
Hi, I've been playing around with asyncore for one of my projects, currently using it to fetch HTTP pages without blocking things. Having a few issues, though. With the code below, I would start a new async_http instance with "async_http(url, returnme)". If it encountered a redirect, that object would start a new one as "async_http(url, returnme, seen=self._seen)" to remember what URLs it had seen. The problem is that after a while...
10
2067
by: Chris Mantoulidis | last post by:
I see some really weird output from this program (compiled with GCC 3.3.2 under Linux). #include <iostream> using namespace std; int main() { char *s; s = "test1"; cout << "s = " << s << " and &s = " << &s << "\n";
11
13726
by: Les Paul | last post by:
I'm trying to design an HTML page that can edit itself. In essence, it's just like a Wiki page, but my own very simple version. It's a page full of plain old HTML content, and then at the bottom, there's an "Edit" link. So the page itself looks something like this: <HTML><HEAD><TITLE>blah</TITLE></HEAD><BODY> <!-- TEXT STARTS HERE --> <H1>Hello World!</H1> <P>More stuff here...</P>
10
1850
by: Bonj | last post by:
Hello. I hope somebody can help me on this, because I'm running out of options to turn to. I have almost solved my regular expression function. Basically it works OK if unicode is defined. It doesn't work OK in ANSI mode however, as it has to use MultiByteToWideChar and WideCharToMultiByte. I've discovered that the regular expression part is working fine. As far as I can tell the regular expression code is correctly parsing what it...
10
4030
by: Charles Law | last post by:
For some reason, when I click the X to close my MDI parent form, the action appears to be re-directed to one of the MDI child forms, and the parent remains open. I am then unable to close the application. What should happen, is that the main MDI form should close, taking the child forms with it. There is code to loop through the child forms, remove the controls on each of them, and then close the form, but this code should execute only...
41
2538
by: Petr Jakes | last post by:
Hello, I am trying to study/understand OOP principles using Python. I have found following code http://tinyurl.com/a4zkn about FSM (finite state machine) on this list, which looks quite useful for my purposes. As this code was posted long time ago (November 1998) I would like to ask if the principles used in this code are still valid in the "modern" Python and if/how it can be improved (revrited) using futures of current version of...
0
1828
by: Tom Edelbrok | last post by:
I'm using VS 2005 to develop an intranet asp.net web application and I get a weird situation. If I start out with any ASPX page that contains an ImageButton control followed by a TextBox control, everything works okay. I can press <ENTER> when the cursor is inside the text box and the page is running, and no events fire (this is what I expect). But as soon as I drop a second text box on the page (ie: after th first one) then pressing...
0
1401
by: RossGK | last post by:
I've been using pydev for a short while successfully, and Django with postgresql as well. psycopg2 is part of that behind the scenes I would imagine, to make django work. Now I'm trying to use psycopg2 in a non-Django program, I'm seeing some weird behaviour My "import psycopg2" is tagged in pyDev (eclipse) as "Unresolved Import: psycopg2"
2
2407
by: Mirko Vogt | last post by:
Hey, it seems that the socket-module behaves differently on unix / windows when a timeout is set. Here an example: # test.py import socket sock=socket.socket(socket.AF_INET,socket.SOCK_STREAM) print 'trying to connect...'
0
9672
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
10439
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...
0
10215
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10165
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
10001
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7541
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
5563
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3727
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2920
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.