Connect by help

Please can someone help
see below example
My aim is to find the top parent node but pass in a lower or joint level item.
So my example here has contains the tree structure
100 'A'
200 'B'
300 'B'
And i require if i put in 300 'B' or 200 'B' it tells me 100 'A' is top of the tree.
I thought the code i did would work but this gives me the wrong level as to what i believe should be top so i am obviousely doing something wrong
level         parent        child
1              300           400
2              200           300
3              100           200but the top level is parent 100 code A should this not be 1 not 3??
This was my query can someone please tell me what im doing wong.
It uses a number and a code to link. so it needs both code and number parent to be correct for link as you could potentially have
parent 100 code A
or
parent 100 code B
And these are two completely different items.
select level, parent,child
from
select 100 as parent,'A' as parentcode,200 as child, 'B' as childcode from dual
union
select 200 as parent,'B' as parentcode,300 as child, 'B' as childcode from dual
union
select 300 as parent,'B' as parentcode,400 as child, 'B' as childcode from dual
connect by child=prior parent and childcode=prior parentcode
start with child=400 and childcode ='B'Edited by: guest1111111 on May 11, 2009 4:16 PM

The first query I gave you does just that:
SQL> ed
Wrote file afiedt.buf
  1  WITH testdata as (select 100 as parent,'A' as parentcode,200 as child, 'B' as childcode from dual union all
  2                    select 200 as parent,'B' as parentcode,300 as child, 'B' as childcode from dual union all
  3                    select 300 as parent,'B' as parentcode,400 as child, 'B' as childcode from dual
  4                   )
  5  select level, parent, child
  6  from testdata
  7  where connect_by_isleaf = 1
  8  connect by child = prior parent and childcode = prior parentcode
  9* start with child=&child and childcode ='&childcode'
SQL> /
Enter value for child: 400
Enter value for childcode: B
old   9: start with child=&child and childcode ='&childcode'
new   9: start with child=400 and childcode ='B'
     LEVEL     PARENT      CHILD
         3        100        200
SQL> /
Enter value for child: 300
Enter value for childcode: B
old   9: start with child=&child and childcode ='&childcode'
new   9: start with child=300 and childcode ='B'
     LEVEL     PARENT      CHILD
         2        100        200
SQL> /
Enter value for child: 200
Enter value for childcode: B
old   9: start with child=&child and childcode ='&childcode'
new   9: start with child=200 and childcode ='B'
     LEVEL     PARENT      CHILD
         1        100        200
SQL>The only thing that changes is the "level" because that is how 'deep' it's had to go to get to the result.

Similar Messages

  • ITunes Store for Windows. Everytime I try an access the iTunes Store it takes really long to connect and then it says iTunes store cannot be access. I think I am up to date with iTunes Verizon 11.0.2.26 but no matter what I try it does not connect. HELP P

    iTunes Store for Windows. Everytime I try an access the iTunes Store it takes really long to connect and then it says iTunes store cannot be access. I think I am up to date with iTunes Verison, I Have 11.0.2.26 but no matter what I try it does not connect. HELP Please???

    With those symptoms, I'd try the following document:
    Apple software on Windows: May see performance issues and blank iTunes Store
    (If there's a SpeedBit LSP showing up in Autoruns, it's usually best to just uninstall your SpeedBit Video Accelerator.)

  • My daughter has just bought me an iPad 2 from Dubai and set it all up for me but unfortunately the iMessage function doesn't seem to work. We keep getting messages,when trying to activate it, that there is a network connection problem - help!

    My daughter has just bought me an iPad 2 from Dubai and set it all up for me but unfortunately the iMessage function doesn't seem to work. We keep getting messages,when trying to activate it, that there is a network connection problem - help!

    Thank you both for your responses but my daughter was reassured by the salesman in the iStyle store (official Apple store in the UAE) that iMessages would work but conceded that FaceTime wouldn't. My iTunes account is registered in the uk and my daughter's iPhone has iMessages even though she bought it (and uses it) in Dubai. Can anyone else throw any light on this?

  • I just got a new Mac yesterday and I am trying to connect my Logitech headset for work but can't!  I plug it into the USB but nothing pops up and I can't find where I go to look to see if it's connected.  HELP!

    I just got a new Mac yesterday and I am trying to connect my Logitech headset for work but can't!  I plug it into the USB but nothing pops up and I can't find where I go to look to see if it's connected.  HELP!

    Ask the Verizon store to exchange your iPhone for a different iPhone 4.
    UPDATE - Sure, try ckuan's solution first.  Then use mine if that fails.
    Message was edited by: sberman

  • I used Face time once and then my MAC tells me my camera is no longer connected.  Help!

    I installed and used Face Time oncem but now when I click on Face time I'm told no camera is connected.  Help!

    http://support.apple.com/kb/HT2090

  • HT204368 I am using iphone 5 and while i am trying to connect my nokia device it's not connecting. Help?

    I am using iphone 5 and while i am trying to connect my nokia device it's not connecting. Help?

    Syncing with iTunes
    How to transfer or sync content to your computer
    If your contacts are in a supported appllication or cloud service, the above will allow for syncing them to the iPhone.

  • My iphone 5 only connects to wifi when i'm in the room which has the router. once i leave i get no connections. please help me.

    i have a iphone 5. i can only connect to the wifi when im in the same room as the router. once i leave my wifi does not connect. please help me fix this.

    Hello nishaanth,
    After reviewing your post, I have located an article that can help in this situation. It contains a number of troubleshooting steps and helpful advice concerning network issues:
    iOS: Troubleshooting Wi-Fi networks and connections
    Thank you for contributing to Apple Support Communities.
    Cheers,
    BobbyD

  • Connect search help to standard table

    hi!
    i want to connect search help to structure P0001-MSTBR, without a repair.
    is it possible? and if so how?
    regards
    yifat

    Hi,
    If you want to add a search help to a structure or a table, it would eb a modification. No other way.
    However, you could decide to program the F4 in your transaction. You could then make use of the FM F4IF_INT_TABLE_VALUE_REQUEST. Just pass to this FM, an internal table of values. Ofcourse you would have to populate some other fields like field name, etc.
    Remember to reward points.
    Rgds,
    Prashanth.
    SAP.

  • My iphone 5 previously can connect to my Wifi at home, but now my phone can't connect to the Wifi even if it's in range , it appears ( unable to connect ) any help please ??

    My iphone 5 previously can connect to my Wifi at home, but now my phone can't connect to the Wifi even if it's in range , it appears ( unable to connect ) any help please ??

    Try reseting network settings.

  • Restore Failure - Could not open connection to helper tool

    I created a disk image on an external firewire drive using disk utility.
    The external drive is bootable and I run the Disk Utility software from the external drive.
    When I try to restore from the image selecting the source and target I get the following error after clicking the "Restore" button:
    "Restore Failure
    Could not open connection to helper tool."
    Any suggestions on how to troubleshoot this?
    Additional info:
    MacBook Pro 2.16 Intel
    Tiger 10.4.7
    Boot ROM MBP12.0061.B00
    SMC 1.5f10
    Internal Hard Disk: ST9120821AS
    External Hard Disk: FireLite FW800
    All software and firmware up-to-date
    Disk Utility 10.5.6 (198.12)

    I've experienced the same problem. What I know is that we built a system image using Disk Utility on a MacPro and we experience this error when attempting to restore the image on another MacPro using Disk Utility.
    I've successfully built system images of MacBook Pros and restored them without any problems. However, I believe I may have built the image using Carbon Copy Cloner. This may warrant some more experimentation using the different utilities.

  • Getting "Could not open connection to helper tool" when restoring a disk

    I have installed OS X 10.4 on to my USB flash drive using the OS X disc that came with my iMac 24". I wanted to use the flash drive for booting the system in case I run into trouble with my iMac.
    Everything was good. I was able to use the flash drive to boot my iMac with no problem. I made an image of the flash drive using Disk Utility. However, when I tried to restore it, Disk Utility kept reporting "Restore Failure: Could not open connection to helper tool". Please tell me what to do.
    The USB flash drive is formatted using GUID Partition table.

    Same problem here.
    I successfully created an image from a drive and I'm trying to restore to another drive.
    I get the "preparing source..." for 2 seconds before the "Restore Failure" dialog with his geeky and meaningless error message. what is helper tool?! I thought I was using Disk Utility!!
    Anybody can suggest a work around for yet another problem missed by QA ?
    thanks in advance.

  • My Apple TV suddenly can't find my network and tells me it is not connected..help?

    My Apple TV suddenly can't find my network and tells me it is not connected..help?  I have reset my time capsule and have all the latest updates. My iPhone and ipad do not show airplay even though I have it turned on in Apple TV.

    Try the following steps, check whether things are working after each step where appropriate, before trying the next.
    Check AirPlay is turned on on the Apple TV (turn it off and on if it already is)
    Check that both devices are on the same network (Settings > Wifi, on the mobile device and Settings > General > Network, on the Apple TV).
    Restart the Apple TV (Settings > General > Restart).
    Restart the Apple TV by removing ALL the cables for 30 seconds.
    Restart your router.
    Restart your mobile device.

  • When i go to sync music from my itunes it says "the mobile device is not started" and it doesnt connect. any help?

    when i go to sync music from my itunes it says "the mobile device is not started" and it doesnt connect. any help????

    For Windows:  iPhone, iPad, iPod touch: How to restart the Apple Mobile Device Service (AMDS) on Windows

  • OpenScript & ant ssh - "Cannot get a connection from helper after 120 seconds"

    Hi, I'm trying to run openscript tests (with runscript.bat file) from hudson. I'm connecting to windows XP machine through ssh and executing batch file, but execution of scipt finishes with error "Cannot get a connection from helper after 120 seconds". This error occurs when openscript tries to run test on Internet Explorer. If IE is not nescessary, test finishes with OK. When running batch directly on windows (without hudson and ssh, but on the same user) everything works fine. Has enyone met with such issue ?

    Hi,
    What Jules has suggested should work, but I have also used the following to get scripts working from OTM -
    OATS Application service - run as a user with local admin rights
    helper service - local system
    OATS agent service - set to manual
    Then, run the agent service as a console app -
    1. run a cmd prompt
    2. Run c:\> C:\OracleATS\agentmanager\bin\AgentManagerService.exe -c C:\OracleATS\agentmanager\bin\\AgentManagerService.conf
    3. Execute the script from OTM
    If the agent is running on a machine separate to OTM then the user will have to remain logged in.
    Cheers,
    Jamie

  • OTM-Cannot get a connection from helper after 120 seconds.

    Can any one tell me how to fix the problem of ,
    OTM not able to run the scripts, and getting the following error:
    "Cannot get a connection from helper after 120 seconds. "
    I have tried un-installing and installing all the services , actually its happening for helper service,but at the same time
    Its working when we use OpenScript, with out any such helper issue but when we use to run the same script using OTM , the above mentioned error message is getting displayed.
    Please let me know a solution, if any one has made a fix for this.
    Thanks in Advance
    Atish

    Hi,
    Step1: Uninstall ATS products and Oracle XE database
    Step2: Remove/Rename the following folders.
    Remove/Rename ATS install directory (e.g. C:\OracleATS).
    Remove/Rename the directory: C:\Documents and Settings\username\osworkspace (depends on your Operating System, it may look like: C:\Users\username\osworkspace)
    Remove/Rename the directory: C:\Program Files\Oracle\Inventory ( depends on your Operating System, it may look like: C:\Program Files (x86)\Oracle\Inventory)
    C:\Windows\rsw.ini
    Step3: Remove the following Services (if services exist)
    Start -> Run. Enter "cmd" Type the command: sc delete servicename
    Oracle Application Testing Suite Application Service
    Step4: Remove the Registry Keys (if exist)
    Start -> Run. Enter "regedit" to launch Registry Editor. Remove the keys below:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Oracle Application Testing Suite Application Services
    HKEY_LOCAL_MACHINE\Software\Oracle\Oracle Application Testing Suite and Oracle Test Management
    Step5: Restart your System
    Step6: Install ATS with admin privilege
    Regards,
    Deepu M

  • A message "unable to connect to help application"

    Hi,
    I am running Photoshop Elements (PSE) 3.0 on a Powerbook G4, 1.25 GHz, 1.5 MB RAM (MacOS 10.4.6) without using Admin rights (because of security concerns).
    Strangely, when trying to get any help from within PSE, after a long wait I get a message "unable to connect to help application". The "Help application" (approx 18 MB) is present in the PSE folder. I have tried to trash PSE from the application folder and re-install. To no avail.
    At times some help with PSE would be nice! How to solve the problem?

    Here I am trying to help a friend with this exact problem over a year later, and there are no answers to the above question. After some searching, I found references to Adobe TechNote 331147, which was created to "help you resolve problems that occur while you use the Adobe Photoshop Elements 3.0 Help application."
    Here's the answer, from that TechNote:
    "The Photoshop Elements 3.0 Help application requires that the user have administrator privileges on Mac OS X."
    So the reason you need administrator privileges is that Adobe has set it up that way. It's that simple, apparently.
    Read the whole TechNote, if you want, at
    http://kb.adobe.com/selfservice/viewContent.do?externalId=331147&sliceId=2
    HTH,
    Bob Leedom

Maybe you are looking for