Connect by - find the top level by pasing in any other level

I have a connect by loop.
select  parent,
child
from parentchild
start with parent = :passed_in_parameter
connect by nocycle prior  child = parentThis works fine but i have an addiitional requirement to find the top level of this tree. By passing in any other level.
i.e.
if i have data as follows:
parent child
1 2
2 3
3 4
4
hierachy
1
2
3
4
Then I need my query to always give me the value 1 (top level) even if i pass in 1, 2, 3 or 4.
Hope this makes sense
Thanks

Hi,
ngac_auk wrote:
... Im trying to prevent a continous loop problem (connect by error) by checking the entire tree (as there can be as many levels as they require) for the entry the user is trying to sabe and if the entry exists then prevent them from adding the new parent child entry.
I thought the best way to do this is by first establishing the top level of the tree (hence my original question) then use another query passing the top level in, to ensure the new entry they want to put in does not already exist.
Is this the best way of doing what i reauire or can people think of a better solution?If there is a loop, then it isn't a tree, and there won't be a top. That's exactly what a loop means: every member of the loop is the ancestor (and descendant) of every member.
Sorry, I don't know enough (yet) about your application to answer your question.
Whenever you have a question, post a little sample data, and the results you want from that data.
In the case of a DML question (like this one: how to prevent DML that causes a loop) post some INSERT statements that show the table without any problems.
For the results, post a series of DML statements (INSERT, UPDATE and or DELETE) to be executed in order, and say whether you want each one to fail or not, and why.
Make sure your sample data resembles your real data. For example, if your real table allows children to have more than one parent, make sure your sample data has an example of that.
There's no need to post a lot of data. If your real trees can go to 50 levels deep, you can post a tree that only goes 3 or 4 levels, and just explain that they can actually go deeper.

Similar Messages

  • XSQL file "Invalid at the top level of the document"

    I am trying to insert HTML form parameters into database using <xsql:insert-request>. It worked fine except that it displays <xsql-status action="xsql:insert-request" rows="1"/> after it inserts the data into the database. I am trying to follow the insertnewsform example in Steve's book "building oracle xml applications" to return user a thank-you note. Here is my problem:
    I have four files:
    faqform.html (html form, action=faqfeed.xsql)
    faqfeed.xsql
    request-to-faq.xsl (used as transform for faqfeed.xsql)
    thankyou.xsl (used for returning user a thank-you)
    When I submit the html form, I get an error saying:
    "The XML page cannot be displayed
    Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.
    Invalid at the top level of the document. Line 1, Position 43
    <?xml version = '1.0' encoding = 'UTF-8'?>"
    I didn't put "encoding..." in any of my xsql files, not sure where that came from. When I used faqfeed.xsql?xml-stylesheet=none in the url and it showed up as a well-formed xml file with all the info I need. Here is my faqfeed.xsql and thankyou.xsl
    ********* faqfeed.xsql ***********
    <?xml version="1.0"?>
    <?xml-stylesheet type="text/xsl" href="thankyou.xsl"?>
    <page connection="template" xmlns:xsql="urn:oracle-xsql">
    <xsql:insert-request table="faq" transform="request-to-faq.xsl"/>
    <xsql:query tag-case="lower" max-rows="5" rowset-element="" row-element="faq">
    select * from faq
    </xsql:query>
    </page>
    ********* thankyou.xsl **********
    <html xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xsl:version="1.0">
    <head><title>Thank you!</title></head>
    <body>
    <h3>Thank you for your faq!</h3>
    Your faq has been successfully inserted to the database!
    <table>
    <xsl:for-each select="page/faq">
    <tr>
    <td><xsl:value-of select="question"/></td>
    <td><xsl:value-of select="answer"/></td>
    </tr>
    </xsl:for-each>
    </table>
    </body>
    </html>
    Anything I am missing here that caused that error? Any hints would be greatly appreciated!
    Wenqi
    null

    Do the XSQL Demos work correctly on your system?
    The error you're getting seems like maybe the *.xsql extension is not mapped properly to the oracle.xml.xsql.XSQLServlet class in your servlet engine.

  • Design Bar in the Top Level Navigation

    hi,
      How to get rid of the Design Bar in the Top Level Navigation, Design Bar is the small space before Home tab in the Portal ?
    Thanks in advance....

    Hi Adi,
    Go to System Administration-Portal Display-Theme Editor-> Choose the theme that you want to change->Portal Mast head->
    On the lower right hand side, you would find a window with a scroll bar, scroll down to Masthead Design bar and if you do not want it to appear, you can try setting the height and width as 0 px. Just play around in here to resolve the isssue.
    Good Luck!
    Sandeep Tudumu

  • Cannot find the Revision Level field in the item details

    Hi All,
    1) I have created a PR with 2 items in the R/3 Backend using the me51n transaction in which for one of the items i have updated the Revision Level field.
    2) To transfer the purchase requisitions created in the above step to the SRM system(sourcing cockpit) i executed  the report BBP_EXTREQ_TRANSFER with transaction SE38.
    3) Now when i go to the SRM portal and navigate to find the external requirement in the sourcing cockpit, I am not able to find the Revision Level field entered in the backend.
    Can some one help.
    Regards
    Sam

    Hi
    Please go through this ->
    Version Management in R/3
    http://help.sap.com/saphelp_47x200/helpdata/en/8a/60b43bb7492147e10000000a114084/frameset.htm
    Versioning in SRM
    http://help.sap.com/saphelp_srm50/helpdata/en/42/c92d6e3ed16babe10000000a1553f6/frameset.htm
    Prerequisites for Version Control in SRM
    I)        You have activated the version control so that the system creates historical versions.
    See the path in the IMG: SRM Server  ®  Cross-Application Basic Settings  ®  Switch On Version Control for Purchasing Documents
    II) You have set up and activated the workflow for the approval of changes to active purchasing documents. See also: Approval Workflows for Documents and Objects
    ( Related link -> http://help.sap.com/saphelp_srm50/helpdata/en/5a/af5efc85d011d2b42d006094b92d37/frameset.htm )
    Some related SAP OSS Notes ->
    Note 1030548 - Revision level in SRM 6.0 connected to ERP 2005
    Note 1026021 - EXTREQ interface: Data transfer structures
    Note 122105 - ME51, RM06BBI0: Revision level is not filled
    Hope this will definitely help.
    Regards
    - Atul

  • How to move all files to the top level folder?

    I want to move all files within a particular folder -- and all files in all sub folders -- to the top level. i.e. I want to collapse the folder structure to just one folder. Assume that there are no files with the same name.
    *Method 1*
    My first thought was to use Find:
    1. Limit Find to the particular folder.
    2. Find all files in the folder with Size > 0.
    3. Switch to List view. All files are listed.
    4. Select all files and drag to the top folder
    5. Delete all sub folders manually.
    Problem: Pages files are not found, and maybe others aren't.
    This is a simple method and I'd like to stick with it.
    *QUES 1*
    What condition should I set within Find so that I can be guaranteed of finding all files?
    *Method 2*
    It was suggested in another thread that I use Terminal to move all files to the top level, but I couldn't get it to work. And there was a problem with files that consist of bundles.
    *QUES 2*
    What is the easiest way to consolidate all files within a folder to the top level -- assume no duplicate names -- and at the same time remove all sub folders?
    Message was edited by: Guy Burns

    Thanks for the suggestion of EasyFind.
    To find all files in a certain folder I typed in *[a-z 0-9] as a Boolean search (this thread won't let me post the exact characters required by EasyFind). That should cover every file I've ever named. EasyFind came back with "11719found/12316done".
    Any idea what the missing 500 files would be? I'm hoping they are files that I don't need to know about (invisible files, system files and so on).
    Message was edited by: Guy Burns

  • Opening a Remote Panel of the Top Level vi for an executable

    Hello Everyone
    I was wondering how you would open up a remote panel for the top-level vi in an executable?
    I have created a LabVIEW application and have tested opening the remote panel when it is running in the full labview development suite - this all works fine. I simply go operate>connect to remote panel and enter the server address, the port (8000) and the vi name using the path "My Project.lvproh/My Computer/main.vi" format.
    However, if I then build this application into an executable I do not seem to be able to open a remote panel - it might be that I am just entering the VI name incorrectly.
    with VI name = "main.vi"  or with VI name = "C:\builds\main.exe\main.vi" and the exe. running I get the error:
    Connecting to remote panel server...
    Requested VI is not loaded into memory on the server computer
    However I am not sure how else I would enter it.
    The main.ini has the following configuration:
    server.app.propertiesEnabled=True
    server.ole.enabled=True
    server.tcp.acl="0800000008000000"
    server.tcp.enabled=True
    server.tcp.paranoid=True
    server.tcp.port=6363
    server.tcp.serviceName=""
    server.vi.access=""
    server.vi.callsEnabled=True
    server.vi.propertiesEnabled=True
    WebServer.Enabled=True
    WebServer.TcpAccess="c+*"
    WebServer.ViAccess="+*"
    DebugServerEnabled=True
    DebugServerWaitOnLaunch=False
    Both machines have LabVIEW 2011 Profesional Development System SP1 on so I do not think it is a limited remote access licence issue.
    Any suggestions as to where I am going wrong would be much appreciated.
    Cheers
    John
    Solved!
    Go to Solution.

    It appears that you can infact use remote panels within an executable.
    The problem I had was that I had left the web server port for the remote panels the same as the LabVIEW development environment. That meant that the main LabVIEW web server was getting in the way of the web server that was associated with my built application.
    With the application's web server on a different port and the VI in memory (and the file in a library/directory external to the exe if it is not the top level VI), you just need to specify the VI name such as main.vi .
    Solved!

  • Adding Content To the Top-Level of Navigation bar ?

    Hi,experts ,
       i have a problem with adding content to the top-level of navigation bar ?
    I have the authority of administration.I have added a customizing role with the entry-point property to myself userid . I have checked my navigation-target page's property can be visible in top-level navigation. I checked my my display level is set as 2 .
       However ,i dont get the folder content at the top-level navigation.Anyway,when i check the delta link trace,there is no folder that connect to my role .
       Anyone helps me out ?
    Thanks in Advance .

    Hi Eleanor,
    If you already created a role with an entry point and assigned it directly to you user, you may just have to refresh the portal page. You may also check the authorizations of you role.

  • How do I keep folder settings below the top level

    There's a certain Finder setting I prefer for folders regarding icon view. I use a size and arrangement that works very well for me. After replacing my older MacBook Pro with a new MBP and transferring all my data, the setting I prefer only works at the top level of any given folder. Any enclosed folder needs to be individually set to my preferred settings. Is there a universal setting in the Finder for folders that will include all enclosed folders?

    There's a certain Finder setting I prefer for folders regarding icon view. I use a size and arrangement that works very well for me. After replacing my older MacBook Pro with a new MBP and transferring all my data, the setting I prefer only works at the top level of any given folder. Any enclosed folder needs to be individually set to my preferred settings. Is there a universal setting in the Finder for folders that will include all enclosed folders?

  • How to change the order of the top level navigation?

    hello,
    i don't find where i can change the order of the top level navigation.
    help would be great because there is no documentation for this issue.
    greets daniel

    If you want to define the sequence of the entry points for display in the portal, you can prioritize the entry points. You define priorities for the entry points by assigning a cetain value to each of the entry points in  the SORT PRIORITY. You may only define values greater than 0 for the priorities  and lower than 100 (default value is 100.0). The smaller the value of the entry point, the further left it moves on the navigation bar. The entry points without a priority appear in any order.
    Hope that helps,
    Frank

  • Help: How to make the top level navigation into vertical at the left panel

    We have a need to change the top-level and 2nd-level navigation bars (horizontal)
    into the nodes on the left navigation panel (vertical).
    We find some way but it is a very extensive job.
    Is there any way to do it quickly?
    Thanks a lot! Points guaranteed.

    Hi,
    Try to develop your own menu by using Navigation Tag Libraries. Check this link :
    <a href="http://help.sap.com/saphelp_nw04/helpdata/en/42/f35146a7203255e10000000a1553f7/frameset.htm">Navigation Tag Library</a>
    There is also sample codes. You can start your project from this codes.
    Regards
    Abdul.

  • EXIT button on the top level form is not working.

    Hi I have 10g forms deployed on the web.
    On the top level form, there is a exit button on it.
    And for this form, under ALERTS I have two alerts viz. QUIT_ALERT and BANNER_ALERT.
    Now when I press the EXIT button on the form, nothing is happening. Neither prompting the ALERT nor closing the FORM.
    Where and What could be the problem??
    I have the following code for the exit button
    IF G$_DISPLAY_ALERT('QUIT_ALERT','Do you really wish to quit?') = ALERT_BUTTON1 THEN
    EXIT_FORM;
    END IFAnd the function G$_DISPLAY_ALERT has following code
    FUNCTION G$_DISPLAY_ALERT(ALERT_NAME IN VARCHAR2,
    MSG_STRING IN VARCHAR2) RETURN NUMBER IS
    ALERT_ID ALERT;
    AL_NAME VARCHAR2(30);
    ALERT_BUT NUMBER;
    BEGIN
    IF ALERT_NAME IS NULL THEN
    AL_NAME := 'G$_WARNING_ALERT';
    ELSE
    AL_NAME := ALERT_NAME;
    END IF;
    ALERT_ID := FIND_ALERT(AL_NAME);
    IF ID_NULL(ALERT_ID) THEN
    RAISE FORM_TRIGGER_FAILURE;
    END IF;
    SET_ALERT_PROPERTY(ALERT_ID, ALERT_BUT, MSG_STRING);
    ALERT_BUT := SHOW_ALERT(ALERT_ID);
    RETURN ALERT_BUT;
    END;Edited by: Charan on Mar 30, 2011 2:01 PM

    seems like some trigger is firing, because i'm getting a CAUTION popup now saying Please Acknowledge.Actually, the PAUSE() built-in is what brings up the "Please Acknowledge" alert. Clearly, your trigger is firing so there must be something wrong with either your WBP trigger code or your G$_DISPLAY_ALERT program unit.
    Try the same technique on your program unit. I would also suggest you display a message in your Exception handler. My guess is that your function is failing but since you don't report the failure, it appears that your code runs successfully.
    FUNCTION G$_DISPLAY_ALERT(ALERT_NAME IN VARCHAR2,
                          MSG_STRING IN VARCHAR2) RETURN NUMBER IS
       ALERT_ID         ALERT;
       AL_NAME          VARCHAR2(30);
       ALERT_BUT        NUMBER;
    BEGIN
       Message('Alert_name: '||ALERT_NAME);
       PAUSE;
    IF ALERT_NAME IS NULL THEN
       AL_NAME := 'G$_WARNING_ALERT';
    ELSE
       AL_NAME := ALERT_NAME;
    END IF;
    ALERT_ID := FIND_ALERT(AL_NAME);
    IF ID_NULL(ALERT_ID) THEN
       Message('Unable to find Alert: '||ALERT_NAME);
       Message('Unable to find Alert: '||ALERT_NAME);
       RAISE FORM_TRIGGER_FAILURE;
    END IF;
    SET_ALERT_PROPERTY(ALERT_ID, ALERT_BUT, MSG_STRING);
    ALERT_BUT := SHOW_ALERT(ALERT_ID);
    RETURN ALERT_BUT;
    END;Then you can see what the value of ALERT_NAME is and verify your code is executing as expected.
    Craig...
    Edited by: CraigB on Mar 30, 2011 12:54 PM

  • I want to change the top level order of itunes playlists

    This is rather odd problem.  There is a lot of information available regarding organising tracks within playlists but I want o change the top level order of the playlist themselves.
    I have an ipod to car CD player adaptor that can select itunes playlists as if they were  single CDs.  The problem is that the adaptors works through the list of itune playlists in order i.e. the first "CD" is the "classical music smart playlist" followed by the other default smart playlists and then by my own playlists.  What I want is force the smart playlists to the bottom of the top level list so that the adaptor finds my playlists first.  I am considering deleting all smart playlists but I see some value in keeping them.  I think the answer is no it can't be done but I be interested to hear if anyone has some ideas on this.
    N.B. I am using itunes 12.01.26 on my Macbook to manage my itunes library.

    Hey guys m I got the answer for the below question.
    Oracle have few Restriction and limitation on such Advanced table in sorting the data,
    Few of them are as mentioned below ...
    1. Sorting is not allowed for tables that allow inserts.
    2. Sorting is not supported for tables containing updateable columns
    3. Sorting is disabled when the Select column is checked for a row in a table or when Hide/Show is present in a table.
    Because of the above limitations , we cannot sort or override the existing alphabetical name sort order to Date applied sort order on the View Applicant advanced table.
    You can observe that , View Applicant page is having an option called "Update Status" which allow us to update applicant’s status or rating in the Advanced table.
    On such updatable advanced tables, oracle does not allow us to override the sort order on any of the table columns.
    Keeping it in a nutshell , I can say it's does not allow us to change the sort order of the view applicant advanced table ( which is having updateable columns ) to sort them in Date applied instead of Name( which is default ).

  • Why do the LabVIEW examples that use the queue design have one loop in the top level and all the others as subvis?

    Specifically the Weather Monitor example under connectivity/Web Services and the FPGA design examples.
    There are several parallel loops. One of the parallel loops will be in the top level VI. The others are all in sub-VIs. After the third example I was looking at it seemed obvious this was being done as a standard, but I don't know why it matters.
    Why not all of them as SubVIs? Why not all of them as top level loops? (Well OK maybe not that one.)

    For me, it depends on what is happening in the parallel loops.  When I have modules that just need to run in parallel with the main loop, it helps reusability to have it a a subVI call.  I can then just copy that library to another project and use it.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • In List View, how can I move an item from within a subfolder up to the top level of the window's parent folder?

    Up 'til now, from System 7.1 to Tiger—I skipped Leopard—you simply dragged the item onto the folder window's titlebar (since that folder's icon was, naturally, not in its own window) and BINGO! there it was, at the top level. Nothing I can think to do in Snow Leopard seems to work.

    Thanks. Most definitely does, although when experimenting I found the left window edge was closer, and 'scrubbing' the item just out of the window and back in seemed to fit the underlying file and folder metaphor better to my mind than just dropping it any old where in the window.
    And 'any old where', at any old speed doesn't always bring up the oh-so-subtle blue border that says, "I get it, you wanna add something to this window, hit me." That's The Clue. There seems to be an invisible line you hafta cross, and some kind of deliberate pace you hafta hit. Too fast and SL doesn't seem to always take it seriously. But that left edge scrub can be quite fast.
    Sorry about the over hasty denial, I was checking my facts and editting to say you were right when the board was shut for some sort of maintenance, and my bad became permanent. Please forgive.

  • Show a menu of roles in the Top Level Navigation

    Hello,
    Imagine a scenario where a user has many roles assigned to him (say 40 roles). In that case the user will have 40 tabs in the first level of the top level navigation and by default a horizontal scroller appears on the right part of the screen clicking on which the roles will scroll horizontally. If the user has to go to the 40th role he has to click quite a lot.
    Is it possible to have a menu option clciking on which we get the all the list of roles in the top level navigation in a vertical list and we can directly jump to any role clicking on the entry in the list ?
    Something like what we get in a tab strip in Web Dynpro.
    Thanks in advance for your valuable inputs.
    Sundeep
    Edited by: Sundeep Sethi on May 3, 2011 3:00 PM

    Hi,
    Yes it is possible to have menus as you wish .
    Look at the following links
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/6066b302-09c8-2a10-a894-eb9fef30df85
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/c0a1aea5-a2d1-2a10-c6bc-953bdadfdcb8?QuickLink=index&overridelayout=true
    You need to work on navigation tag libraries to extend number of levels .
    The above inks helps you only for single level of navigation.
    Regards
    Karthiheyan M

Maybe you are looking for