Hierarchical query - How to get all parent records - Duplicate post

Hi,
In Oracle, START WITH, CONNECT BY commands will give all the direct and indirect child records. Other way round, is they are command which gives all the parent records till the root? Please let me know. I am working on Oracle 9i Release 2.
Thanks a lot for your help.
Edited by: skv on Nov 21, 2008 11:05 AM

Duplicate post.
Hierarchical query - How to get all parent records
Please edit this post heading to duplicate post.
Regards.
Satyaki De.

Similar Messages

  • Hierarchical query - How to get all parent records

    Hi,
    In Oracle, START WITH, CONNECT BY commands will give all the direct and indirect child records. Other way round, is they are command which gives all the parent records till the root? Please let me know. I am working on Oracle 9i Release 2.
    Thanks a lot for your help.

    Hi - I believe what you want is the "SYS_CONNECT_BY_PATH" function (research it in the SQL Reference Guide).
    Here is an exampe:
    SELECT     empno
             , ename
             , mgr
             , LTRIM (SYS_CONNECT_BY_PATH (ename, ' -> '), ' ->') AS emp_path
             , LEVEL AS emp_level
          FROM scott.emp
    CONNECT BY PRIOR empno = mgr
    START WITH mgr IS NULL;
    Result:
         EMPNO ENAME             MGR EMP_PATH                                  EMP_LEVEL
          7839 KING                  KING                                              1
          7566 JONES            7839 KING -> JONES                                     2
          7788 SCOTT            7566 KING -> JONES -> SCOTT                            3
          7876 ADAMS            7788 KING -> JONES -> SCOTT -> ADAM                    4
          7902 FORD             7566 KING -> JONES -> FORD                             3
          7369 SMITH            7902 KING -> JONES -> FORD -> SMITH                    4
          7698 BLAKE            7839 KING -> BLAKE                                     2
          7499 ALLEN            7698 KING -> BLAKE -> ALLEN                            3
          7521 WARD             7698 KING -> BLAKE -> WARD                             3
          7654 MARTIN           7698 KING -> BLAKE -> MARTIN                           3
          7844 TURNER           7698 KING -> BLAKE -> TURNER                           3
          7900 JAMES            7698 KING -> BLAKE -> JAMES                            3
          7782 CLARK            7839 KING -> CLARK                                     2
          7934 MILLER           7782 KING -> CLARK -> MILLER                           3
    14 rows selected.Good luck...

  • How to get all the Record Groups?

    in the form i had created a record group. let us say they are:
      RG_APPR_TYPE_CDE_LIST
      RG_DRV_APPR_TYPE_CDE_LIST
      RG_PROJ_MODE_CDE_LIST
      RG_DRV_PROJ_MODE_CDE_LIST
      RG_PROJ_STATUS_CDE_LIST
      RG_DRV_PROJ_STATUS_CDE_LIST
      RG_ORG_SUB_TYPE_CDE_LIST
      RG_DRV_ORG_SUB_TYPE_CDE_LIST
      RG_REGION_NUM_LIST
      RG_DRV_REGION_NUM_LISTwhen the form hits on the clear button it invoke the CLEAR_FORM. i want to get all the record groups dynmically so i won't have to explicitly call the
      Delete_Group('RG_APPR_TYPE_CDE_LIST');
      Delete_Group('RG_DRV_APPR_TYPE_CDE_LIST');
      Delete_Group('RG_PROJ_MODE_CDE_LIST');
      ...one by one. is there any other workaround? i appreciate any help on this. thanks.

    is there any other workaroundNo.

  • How to get all the records in the RSA3 extratcion

    Hi All
    i have problem in seeing the records at RSA3. when i load the data im getting around 14k records when i want to see all the records ,i am not able to see that.. but the records are available in tables...
    i want to see the the some asset numbers but for RSA3 its getting me upto 1k records..
    I want to check my datasource is that working properly or not.
    please help me
    regards
    AK

    Thanks alot Bhanu ,,,,
    Actually i was not concentrating on the first screen ...always going to next screen and searching for defferent searching ...
    got the records now thanku very much
    Rewarded points
    Regards
    AK

  • How to get master data records that do not have transaction data in a query

    Hi,
    How to get master data records that do not have transaction data in a query output. Can we create a query or any other way to get the master data records that do not have transaction data?

    Hi,
    Create a multiprovider which includes transactional data target and master data info object. Make sure that identification for this master data info object is ticked on both the provider.
    Create report on this multiprovider , keep the master data info object in rows , and now you should able to see all the values which are there in master data info object irrespective of transaction happened or not .
    Next you may create condition showing only zero keyfigure values , ie. master data without any transaction.
    Hope that helps.
    Regards
    Mr Kapadia

  • How to get all rows that are returned in inner sub query of select statemen

    If a sub query in select statement returns more than one row than how to get all those returned rows in the final
    output of the query .It will be all right if all column's value repeat and that multiple output of inner query comes
    in another column .
    How to get that ?

    As Frank said, you likely want a join, and likely an outer join to replicate the select in the projection. Something like:
    SELECT id,stat, section, USER_ID concerned_person
    FROM table_all,
      left join table2
        on room_id = sectoion and
           sur_role = 'r001'
    WHERE section IN (SELECT code
                      FROM t_area
                      WHERE dept= 'p002')An alternative, depending on where and how you are using the statement would be something like:
    SQL> WITH t AS (
      2    select 1 id from dual union all
      3    select 2 id from dual),
      4  t1 as (
      5    select 1 id, 'One' descr from dual union all
      6    select 1, 'Un' from dual union all
      7    select 1, 'Une' from dual)
      8  SELECT t.id, CURSOR(SELECT t1.id, t1.descr from t1
      9                      WHERE t1.id = t.id)
    10  FROM t;
                      ID CURSOR(SELECTT1.ID,T
                       1 CURSOR STATEMENT : 2
    CURSOR STATEMENT : 2
                      ID DESCR
                       1 One
                       1 Un
                       1 Une
                       2 CURSOR STATEMENT : 2
    CURSOR STATEMENT : 2
    no rows selectedJohn

  • How to get all records using Invoke-webrequest?/Why Invoke-webrequest returns only first 2000 Records?

    invoke-webrequest content returning only 2000 records though it has around 4000 records in web api.
    The same url if I give in excel oData Data feed I am getting all the records.
    See the below script
    Script:
    $QueryResult= (Invoke-WebRequest -Uri $ODataURI -UseDefaultCredentials)
    [xml]$xmlResult=$QueryResult.content
    foreach($obj in $xmlResult.feed.entry.content.properties)
    $Name=$obj.Name;
    $IsAvail=$obj.isAvail.'#text';
    $PGroup=$obj.PGroup
    I am exporting the above result as a CSV file and my CSV file contains only 2000 records. 
    But,  $xmlResult.feed.Count --> it Shows 4000 Records.
    The same Odata url if I give in excel oData Data feed I am getting all the 4000 records.
    So Please help me how can I get all the records using power shell.
    Thanks
    A Pathfinder..
    JoSwa
    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful"
    Best Online Journal

    Hi Jo Swa(K.P.Elayaraja)-MCP,
    Would you please also post code which is used to export the records?
    In addition, to use the cmdlet invoke-RestMethod to work on ODate feeds, please refer to this article:
    Interacting with TechEd NA 2012 Schedule using PowerShell v3
    I hope this helps.

  • How to fetch all the records

    Hello everybody,
    I am currently working on SQL Developer for the couple of weeks. I have specific need to check, how much time one query take to fetch all the records. Currently it can fetch only 50 records and when scroll then next 50 records and so on.
    Can anybody tell me, how to set this to fetch full records
    Regards,
    Martand M Joshi

    Martand,
    There's no setting to fetch all records. You wouldn't like SQL Developer to fetch for minutes on big tables anyway.
    If, for 1 specific table, you want to fetch all records, you can do Control-End in the results pane to go to the last record. You could time the fetching time yourself, but that will vary on the network speed and congestion, the program (SQL*Plus will be quicker than SQL Dev because it's more simple), etc.
    Now, what I think you really want here, is getting the execution time. If you really want to analyze the query's performance, you'd have to use the explain plan, autotrace and tkprof (see the manual for tuning and performance).
    To make us life easier, the makers of SQL Developer included support of the explain plan, and as of v1.1, autotrace!
    I'm sure you've got enough to work things out from here...
    Regards,
    K.

  • How to get all INDEXes from a database

    How to get all INDEXes in a database? I need to store them in script file (.SQL). My database version is 10.2.0.3.0.
    Edited by: Iniyavan on Sep 18, 2009 1:39 PM

    --Thanks, Koppelaars. The second query works. But I'm unable to store in spool file. May be it's due to CLOBs in the output. I did the following:
    set head off
    set feedback off
    set linesize 32727
    set pagesize 50000
    spool c:\indexes.sql
    select dbms_metadata.get_ddl('INDEX',INDEX_NAME,'MYSCHEMA')
    from user_indexes;
    spool off
    --In the spool file, I find only this
    CREATE UNIQUE INDEX "MYSCHEMA"."A" ON "MYSCHEMA"."BNK_DEALID" ("DEAL_ID")
    PCTF
    CREATE INDEX "MYSCHEMA"."ACCENT_RAC_REPORT" ON "MYSCHEMA"."ACCENT" ("SCHEME", "VAL
    CREATE INDEX "MYSCHEMA"."ACCENT_REPORT" ON "MYSCHEMA"."ACCENT" ("SCHEME", "APP_REF
    CREATE UNIQUE INDEX "MYSCHEMA"."ACCENT_X" ON "MYSCHEMA"."ACCENT" ("DEAL_ID")
    P
    CREATE UNIQUE INDEX "MYSCHEMA"."ACCNAV_X" ON "MYSCHEMA"."ACCNAV" ("SCHEME", "ACCNA
    --How to get all the DMLs in one SQL file?
    --Nagappan, I'm using WIN.

  • How to get all the values of a variable with F4 with checkboxes to select

    Dear Experts,
    After Executing a query by giving let 3 values(Out of 10 Values) to a variable.
    To give 2 more input values to the same variable(i.e.,total I wanted to give 5 inputs this time ),after refreshing the query,for that variable if I click F4, I am seeing the historical values(i.e.,3) and remaining 7 values also But with out any Check Boxes besides them to select the 2 inputs.
    In the same F4 Screen, If I click all values(an Icon at The bottom),then also Im seeing but no check Box.
    I hve tried by deleting the Delete Personalization also,but no use.
    Please tell me How to get all the values with F4 with check boxes to select ,whatever I want??
    Thanks in advance

    Take a look at the InfoObject and go to the Business Explorer tab. If the 'Query Def. Filter Value Selection' is set to 'Only Values in InfoProvider', you're only going to get the values in F4 that exist in the InfoProvider, not everything in the Master Data. This would need to be changed to the value of 'Values in Master Data Table' if you want it to show everything possible when F4 is chosen.
    Likewise, you're going to need to look at the query and go to the Advanced tab for the InfoObject. Make sure that the radio button for 'Values in Master Data Table' is selected. If not, then you should change that selection.

  • How to get all images in indesign CS5 with javascript?

    Hi,everybody,
    How to get all images in indesign CS5 with javascript?I want to delete them.
    Anyone can give me some example codes?
    Thanks,
    Bridge

    Hey!
    This will remove all images from your InDesign document:
    var myLinks = app.activeDocument.links.everyItem().parent;
    for(var i = 0; i < myLinks.length; i++)
        myLinks[i].remove();
    Hope that helps.
    tomaxxi
    http://indisnip.wordpress.com/
    http://inditip.wordpress.com/

  • How i get number of record in repet frame?

    Hi,
    How i get number of record in repet frame?
    Regards
    Jomar

    Jomar,
    you can use Summary Columns in the Data Modell. Create them on group higher that your wished group (so on the pane for an first group of a query), use as Source the primary column and as reset at the group, where the summary column is located.
    If you hide some instances via format triggers, that you could use a counter inside the format triggers to count the rows.
    Regards
    Rainer

  • How to get only active records from MDM.

    Hi all,
      How can i get only the active records from MDM table.Now i am getting all the records in MDM table in my Master Report Iview.Only some of the records r active.can i get just the active records.If yes,how can i do that.
    regards
    kukku

    closing

  • How to get a total record count before grouping?

    I need to group a report on a formula that does roughly the following:
    [record count] / ( [total record count] / 20 )
    What this acheives is to label each record with a number of 1 - 20 which I want to group on. Getting this figure is the easy part, what is not working is the fact that I cannot group from a formula that is calculated after grouping. I overcame a portion of this by using "Whilereadingrecords" (rather than "count", running totals, or while printing records) to acheive a record count.
    I can't figure out how to get a total record count done before grouping. Is there a way to do this with "WhileReadingRecords"?? Is this even possible?
    Thanks
    John

    Hi John, 
    The order of how Crystal does things dictates the order of which features you can use.  Crystal has a two pass method.  In the first pass it does things like passing the query, grouping, summarizing.  In the second pass it does formulas, formatting, etc. 
    Unfortunately Crystal does the Grouping before summarizing so what you want to do can't be done in Crystal.  The best way to get around this to either create a SQL Command or view/stored procedure that will do the summarizing for you.  Then in the report you can use it. 
    Hope this helps,
    Brian

  • How to get all the values from the dropdown menu

    How to get all the values from the dropdown menu
    I need to be able to extract all values from the dropdown menu; I know how to get all those values as a string, but I need to be able to access each item; (the value in a dropdown menu will change dynamically)
    How do I get number of item is selection dropdown?
    How do I extract a ?name? for each value, one by one?
    How do I change a selection by referring to particular index of the item in a dropdown menu?
    Here is the Path to dropdown menu that I'm trying to access (form contains number of similar dropdowns)
    RSWApp.om.GetElementByPath "window(index=0).form(id=""aspnetForm"" | action=""advancedsearch.aspx"" | index=0).formelement[SELECT](name=""ctl00$MainContent$hardwareBrand"" | id=""ctl00_MainContent_hardwareBrand"" | index=16)", element
    Message was edited by: testtest

    The findElement method allows various attributes to be used to search. Take the following two examples for the element below:
    <Select Name=ProdType ID=testProd>
    </Select>
    I can find the element based on its name or any other attribute, I just need to specify what I am looking for. To find it by name I would do the following:
    Set x = RSWApp.om.FindElement("ProdType","SELECT","Name")
    If I want to search by id I could do the following:
    Set x = RSWApp.om.FindElement("testProd","SELECT","ID")
    Usually you will use whatever is available. Since the select element has no name or ID on the Empirix home page, I used the onChange attribute. You can use any attribute as long as you specify which one you are using (last argument in these examples)
    You can use the FindElement to grab links, text boxes, etc.
    The next example grabs from a link on a page
    Home
    Set x = RSWApp.om.FindElement("Home","A","innerText")
    I hope this helps clear it up.

Maybe you are looking for

  • How to install Windows? Missing checkbox in Boot Camp.

    When I try to install windows 8 Boot Camp seems not want me to create an installation disk. The support pages show me some Boot Camp screen where one can choose to create an installation disk, but my Boot Camp does not show the same three options. I

  • Using Indesign CC (2014) 10.1.0.71 (swedish version) ARABIC in indesign. Download Plug-in or whole program "Arabic version"? Link?

    A client wants me to work on a text which is both english and arabic. I heard this is only possible with the arabic version of indesign? If I place the text in my present version, it comes out unreadable (arabic letters/words -but not connected and j

  • Sound not recignizing my internal speakers

    Hi: My parents iMac is not recignizing the internal speakers in their Mac. When we try to change the volume, it has a cirlce that is crossed out. Any help would be great Thanks

  • IDM  :  Customizing User Forms and/or Interfaces

    Good morning. Ok, I do not know if this is the right place to post this Issue. But, I can't seem to find any other forum which deals directly with IDM issues (believe it or not, Sun's Website is absolutely USELESS). Here's the thing : I am currently

  • Flex with a Scanner

    Hello, We are looking to integrate a standard scanner or business card scanner into our Flex 2 environment. We would very much appreciate any guidance on creating a solution that would potentially be plug and play for our users. In a perfect world, t