Need to find region and its sub region

Hi,
I have a table levels which has record at any levels.
levels_id region_name region_parent
1 xyz 0
2 xyz1 1
3 xyz2 2
4 xyz3 3
5 xyz11 1
6 xyz12 5
7 xyz21 1
8 xyz22 7
9 **** 100
10 ***1 101
i need to find all the region under levels_id = 1 at any levels
Please help me
regards
shyam

is this what you are after?
with t as
(select 1 levels_id,  'xyz' region_nm,  0 region_parent from dual union
select 2, 'xyz1', 1 from dual union
select 3,'xyz2', 2 from dual union
select 4, 'xyz3', 3 from dual union
select 5, 'xyz11', 1 from dual union
select 6, 'xyz12', 5 from dual union
select 7, 'xyz21', 1 from dual union
select 8, 'xyz22', 7 from dual
select /*levels_id, region_nm, region_parent,  */
substr(sys_connect_by_path(region_nm, '-->'),4)  from t
where connect_by_isleaf = 1
--start with  region_parent = 1
connect by prior region_parent = levels_id
xyz
xyz1-->xyz
xyz2-->xyz1-->xyz
xyz3-->xyz2-->xyz1-->xyz
xyz11-->xyz
xyz12-->xyz11-->xyz
xyz21-->xyz
xyz22-->xyz21-->xyz

Similar Messages

  • I bought an iphone and the guy has not used it in a year now i need to activate it and its linked to his icloud account so i cannot turn the phone on what can i do ???

    i bought an iphone and the guy has not used it in a year now i need to activate it and its linked to his icloud account so i cannot turn the phone on what can i do ???

    Here's what you can do:
    Find My iPhone Activation Lock: Removing a device from a previous owner’s account
    If you can't get the info needed, you can't use the device, sorry.

  • Ok, i have lost my ipod and i REALLY need to find it, and i have no idea how i can track it. HELP!!!!

    ok, i have lost my ipod and i REALLY need to find it, and i have no idea how i can track it. HELP!!!!

    There is no way to track a lost or stolen iPod Classic. Sorry.
    Reporting a lost or stolen Apple product
    B-rock

  • Mapping and creating new instances of a node and its sub-nodes

    hi,
    i need to map every 3 items from source interface to 1 in target interface.
    i have on target interface parent node which is called 'item' and occurs 0..unbounded (and other sub-nodes).
    this node have a sub-node which is called 'item_data' and occurs 0..3.
    i created a mapping:
    source_item ->counter->checking mod 3--->if   
    """""""""""""""""""""""""""""" source_item  -
    > then -
    >item.
    when i test mapping with 1-3 source_item the sub-nodes 'item_data' are created,
    but when i try 4-5 and more , 'item' node is created  twice but the second instance has no sub-nodes of
    'item_data' (it has other sub-nodes).
    can someone tell me how to solve my problem?
    thanks in advance.
    Tomer

    I would like to be clear about the requirement first,
    Source                              Target
    item           -
    >             item
       item_data     -
    >               Item_data
    item           -
    >            
       item_data     -
    >               irem_data
    item           -
    >            
       item_data     -
    >               item_data
    item           -
    >             item
       item_data     -
    >               item_data
    item           -
    >            
       item_data     -
    >               item_data
    item           -
    >            
       item_data     -
    >               item_data
    for the mapping of item node the queue should look like:
    contextchange
    Then for the mapping of item_data the queue should look like:
    item_data
    item_data
    item_data
    context change
    item_data
    item_data
    item_data
    I guess you have used some udf for the target parent node (item) mapping. I am trying myself to generate the queue for item_data using standard functions, but yet to come up with the desired result. If achieved will let you know..................for now it seems that writing a UDF (queue) would be the best approach.
    iterate through the input queue array (source item_data values all in same context using RemoveContext) and insert a ResultList.CC after every third element in the array.
    Hope you can come out easily with the java for this logic. Let me know if it's helpful.
    Regards,
    Suddha

  • Scrap Asset and its sub assets in one transaction code

    Please suggest if it is possible to scrap an asset and all its sub assets in one transaction as opposed to scrapping them separately in ABAVN.
    regards
    Rekha

    Click on the button Multiple assets and fill in there the main asset and sub numbers. You have to fill them all in. There is no transaction that you can do this with filling in only the main-asset number

  • Getting all webI reports in a folder and its sub-folders using java sdk.

    hi,
    I need a java code to get the Id of all webi  reports in a folder and recursive sub folders .
    Is there any sample code or tutorial  available for It?
    regards,
    nitin

    I didn't test this but it should work. Import required packages.
    <%
    String username = "administrator";
    String password = "<password>";
    String cmsname = "<cmsname>";
    String authtype = "secEnterprise";
    IEnterpriseSession oEnterpriseSession = CrystalEnterprise.getSessionMgr().logon(username, password, cmsname, authtype);
    IInfoStore oInfoStore = (IInfoStore)oEnterpriseSession.getService("","InfoStore");
    getWebi(oInfoStore,0,out);
    oEnterpriseSession.logoff();
    %>
    <%!
    public void getWebi(IInfoStore oInfoStore, int sourceFolderID, javax.servlet.jsp.JspWriter out)
    try
         String query = "select * from ci_infoobjects where si_kind='webi' and si_instance =0 and si_parentid =" + sourceFolderID ;
         IInfoObjects oInfoObjects = oInfoStore.query(query);
         for(int i=0;i< oInfoObjects.size(); i++)
              IInfoObject oInfoObject = (IInfoObject) oInfoObjects.get(i);
              out.println(oInfoObject.getID() + "  " + oInfoObject.getTitle() +"<br>");
         String query = "select * from ci_infoobjects where si_kind='folder' and si_parentid = " + sourceFolderID ;
         oInfoObjects = oInfoStore.query(query);
         for(int i=0;i< oInfoObjects.size(); i++)
              IInfoObject oInfoObject = (IInfoObject) oInfoObjects.get(i);
              getWebi(oInfoStore, oInfoObject.getID(), out);               
    catch(SDKException e)
         out.println(e.toString());
    %>

  • Need help finding Sound and Vibration Toolkit Example Files

    I need help finding some Sound and Vibration Toolkit Example Files?
    http://www.ni.com/white-paper/3779/en
    From this link you get:  getting_started_otb.llb
    The missing files are:
    OAT Truncate Time Indices.vi
    Speed profile.ctl
    oa_Config Time or RPM Segment.vi
    svl-Complex Datatype Default.vi
    Running Windows 7, LabVIEW 2011, 32bit
    Sound and Vibration Measurement Suite
    Sound and Vibration Toolkit
    Thanks,
    -SS
    Solved!
    Go to Solution.
    Attachments:
    License S and V.png ‏4 KB

    SS,
    You can find these files here:
    C:\Program Files (x86)\National Instruments\LabVIEW 2011\vi.lib\addons\Sound and Vibration\Order Analysis\Resample Order Tracking\SubVIs
    C:\Program Files (x86)\National Instruments\LabVIEW 2011\vi.lib\addons\Sound and Vibration\Order Analysis\Tach Process\SubVIs
    C:\Program Files (x86)\National Instruments\LabVIEW 2011\vi.lib\addons\Sound and Vibration\Order Analysis\Resample Order Tracking\SubVIs
    svl-Complex Datatype Default.vi changes to svc-Complex Datatype Default.vi
    C:\Program Files (x86)\National Instruments\LabVIEW 2011\vi.lib\addons\_NISVFA\_Shared subVIs\Common
    Make sure you are license activated, and you will have to dig through the *vi and relink a subvi.
    Then you should get a white arrow.
    -SS 

  • IDOC - How to relate a segment and its sub segment

    consider this scenario
    E1MBXYH : Goods movements for mobile data entry (header data)
    Status: Required , min. number : 1 , max. number : 1
        E1MBXYI : Add goods movement from external system: Item
        Status: Required , min. number : 1 , max. number : 9999
             E1MBXYJ : Create Goods Movement from Non-SAP System: Item++
             Status: Optional , min. number : 1 , max. number : 1
    E1MBXYJ is a sub segment of EIMBXYI
    For every record in segment EIMBXYI i have to find 1 coressponding record in segment EIMBXYJ
    Loop at idocdata where segname='EIMBXYI'
    Loop at idocdata where segname='EIMBXY'  and   ?
           endloop
    endloop
    How do i find the relation between the 2 segments. There are no common fields for the segment structures.
    Message was edited by:
            raja

    Hi Raja,
    The is automatically governed by the hierachy and the occurrences that is defined in WE30 for an IDoc type.
    In WE30 we create the segment hierachy (parent and child). Double clicking any segment will lead to its occurrences (min and max). You can also navigate to segment editor to see the fields in that segment.
    Idoc data is just an internal table, we just append segments to that table based on the occurrences in the sequence (child cannot occur before parent) shown in the hierarchy in WE30.
    So you have to deal with indexes in this case. So EIMBXYI will occur first followed by child E1MBXYJ in the idoc_data internal table.
    If there are 10 E1MBXYI then also this order will be followed - E1MBXYI followed by E1MBXYJ and so on..
    Hope this helps.
    Regards,
    Gajendra.

  • Trying to update iphone 4 to IOS 7 says i need to update itunes and its already updated

    Im trying to update my Iphone 4 to IOS 7 and it keeps telling me I need to update my Itunes I have the most current version of Itunes and that is as far as my update will take me...how do I get past this??

    just like to correct: im on iOS 4.3.1 
    also additional info:
    - secondly i have restarted my phone and restarted itunes many times  & i have the latest version of itunes
    - restarted everything again. i synced my phone for the fun of syncing hoping that might help although i didnt have anything to sync but anyway now its reduced the time & said "8hours remaining" but in the space of 10minutes went up to "11hours remaining" seriously? please help .
    thanks

  • Im on a Mac OS X 10.6.8 and i need 10.7 Lion and its not letting me download it because i want to download it for a minecraft bukkit server everytime i run it says this requires 10.7 lion or higher and im trying to download that! What do i do?

    i really need to know how

    You need to purchase Lion from the App Store, which should start it downloading.  Is that how you are downloading it, and if so, how is it not working?

  • Need to find Holidays and Day

    Hello All,
    I have the PLANT and DATE.
    With these details how can I find
    1. DATE is a holiday?
    2. DATE is which day(Mon, Tue,..., Sun)?
    Good answers will be appreciated.
    Thanks in advance.
    Best Regards,
    Sasidhar Reddy Matli.

    Try function module [DATE_CONVERT_TO_FACTORYDATE|https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=date_convert_to_factorydate&adv=false&sortby=cm_rnd_rankvalue] or [HOLIDAY_CHECK_AND_GET_INFO|https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=holiday_check_and_get_info&adv=false&sortby=cm_rnd_rankvalue] the factory calendar comes from table T001W.
    Regards

  • U160: Need help finding one and your opinion. Hardware update coming soon?

    I really want to pick up an Ideapad u160 after playing around with a x120e for the last week. But, in the US it is nearly impossible to find one.
    Lenovo does offer the Core i3 version for $750 (a bit over priced in my opinion) from the website, but only in brown. I would love to get a black on with an i5 or i7.
    The only place I could find them was on eBay and that was a refurbished one: http://cgi.ebay.com/LENOVO-Ideapad-U160-12-500GB-4GB-BT-i7-640UM-Ultrathin-/270778848252?pt=Laptops_...
    How are Lenovo's refurbished laptops? And I am guessing the u160 would be a huge bump in performance from the x120e.
    Finally, there has been no talk of a refresh for the u160 line right? I would hate to buy one and then be left with the old modle.
    Thanks!

    You don't want to reset all settings .... You have to totally restore the iPad to factory settings which erases the device. After you restore the iPad, you can sync your content back onto the iPad from your iTunes library.
    Read this to see what I am talking about. This article talks about the iPhone, but it works the same way with an iPad or an iPod Touch.
    http://www.maclife.com/article/howtos/how_recover_your_restrictions_password
    Do you sync with iTunes on a regular basis? If yo don't, you can download past purchases as long as you use the same Apple ID that you originally bought the content with and as long as the content is still available in the stores (iTunes, the App Store or the iBooks Store).
    When you restore the iPad to factory settings, your son's game progress will be lost as well, so keep that in mind. All app data and settings will be erased when you restore as a new device.
    This discussion has some helpful tips on how to save some of the iPad content before you restore as new.
    https://discussions.apple.com/thread/3695870?tstart=0
    Message was edited by: Demo

  • HT1577 I am trying to upgrade iPhoto to v9.4.2(4+) and the message says library needs to be upgraded and its just stuck there for 6 hours

    I am trying to upgrade iphoto to v9.4.2(4+) and it has frozen trying to upgrade my large photo library

    hello, it sounds like the library is damaged.
    Download iPhoto Library Manager and use its rebuild function. This will create a new library based on data in the albumdata.xml file. Not everything will be brought over - no slideshows, books or calendars, for instance - but it should get all your albums and keywords back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one. 

  • Get active employees of organization unit and its sub organization unit

    Hi,
    I have OU in selection screen. If I give 50000000 in the selection screen and my list displays all the active employees under that organization unit.
    but under 50000000 OU,it contains some other OU like 500000010 nd so on.. (ie,sub OU). now i want to display the active emplyees of these sub OU also...
    give me any function module to get this???
    thanks n advance

    Eg:
    ACT_OTYPE        -
                   O
    ACT_OBJID         -
                  00100000
    ACT_WEGID          -
                 O-O-S-P
    ACT_INT_FLAG
    ACT_PLVAR            -
               DA
    ACT_BEGDA             -
              02.06.2009
    ACT_ENDDA           -
                02.06.2009
    ACT_TDEPTH                          0
    ACT_TFLAG       -
                    X
    ACT_VFLAG        -
                   X
    AUTHORITY_CHECK        -
             X
    TEXT_BUFFER_FILL
    BUFFER_MODE
    F8 - execute
    check for the result in
    RESULT_TAB
    u can check the level in RESULT_STRUC

  • My phone is locked and doesnt recognize me as a Developer.  Need to find UDID and cannot use Itunes or the phone, any ideas?

    I have a new phone, through AT&T insurance, and it does not recognize me as a developer until i register UDID.  But the phone is locked and has never synced to Itunes so how the **** do I find the UDID number?  This one is stumping me?

    Ok next problem currently my MAC is with my daughter out of state, I only have a PC in the house...

Maybe you are looking for

  • Hard drive issue?

    I've been having regular problems with my early 2008 iMac (2.4 GHz Intel, 250 GB SATA HD) freezing up, accompanied of course by the spinning rainbow "wheel of death".  The problem is particularly pervasive when I wake the computer from several hours

  • My hard disk is damaged and i have no external hard drive, and i was wondering, if i sent my computer to Apple, would they back up my files for me before repairing it?

    My hard disk has been damaged for about 4 months now. When I ran the disk repair under disk utility, it told me to back my files and send it in for repairs. My problem is that I had a external hard drive, but I lost it, so I obviously can't back up m

  • Convert Amount in Numbers into Amount in Words

    Hello everyone, I am tasked to draft format for our company's check printing layout using Numbers/Pages, I already did but since the existing format was just manual inputted by the users, it always resulting to typographical errors on our printed che

  • ICloud and outlook problem

    I use a pc for my work calendar and a mac at home.  I had my work calendar so I could view and edit it on my personal calendar (mac) with mobileme I updated to iCloud now my work calendar on outlook won't open it says "The set of folders cannot be op

  • FLV Editing in Adobe Products?

    Hi Gang, I am currently producing/hosting a TEQUILA reviews LIVE streaming webcast  ( http://tequilawhisperer.com ) .  I use the Flash Live Media Encoder to create my stream.  I'm wondering if "After Effects" allows native editing of the .FLV file?