How to select certain xml group based on attribute id and return as xmltype

hi,
i have an xmltype column name "NM" in table "XMLTEST", the content of the xml in NM is
<ct>
<sp id="ALEX">
<sp id="JOHN">
<sp id="MIKE">
<sp id="CALEB"/>
<sp id="PAUL"/>
</sp>
</sp>
<sp id="MAX">
<sp id="WAYNE"/>
</sp>
<sp id="MAX"/>
</sp>
</ct>
The group i want to select is ALEX except group "MIKE" and "MAX", which return
<ct>
<sp id="ALEX">
<sp id="JOHN"/>
<sp id="SEAN"/>
</sp>
</ct>
Is it possible? i'm processing this using stored procedure PL/SQL, my environment is 11g R2 Win 32bit.
please advice,
wesley

Hi,
Not sure where "SEAN" comes from... Typo?
Try with deleteXML :
SELECT deleteXML(t.nm, '/ct/sp[@id="ALEX"]//sp[@id="MIKE" or @id="MAX"]')
FROM xmltest t
;

Similar Messages

  • How to get 2 xml(Sibling tag) content same time and merge them

    how to get 2 xml(Sibling tag) content same time and merge them and search the result value in indesign file with page number  
    Like
    <Record>
    <A>this is a text</A>
    <B>a-123</B>
    </Records>
    First we need  tag A and B value as  :
    this is a text - a-123 and then get  this text page number form the indesign doc
    plz help

    hi
    var root = app.activeDocument.xmlElements[0];
    var aTag = root.evaluateXPathExpression("//Record/INAAMF");
    var bTag = root.evaluateXPathExpression("//Record/IAFKF");
    here I got  aTag  and bTag  = empty
    may be the reason is as I forgot to menion the proper XML path as
    <Records>
    <Record>
    <A>this is a text</A>
    <B>a-123</B>
    </Record>
    <Record>
    <A>Second text</A>
    <B>a-132</B>
    </Record>
    <Record>
    <A>Thied text</A>
    <B></B>
    </Record>
    <Records>

  • How to select certain photos/events to show up on desktop?

      I would like to select certain event folders from IPhoto to show up on my desktop screen saver. Is there a way to do that?  My problem, is that certain photo's show up that I may have even deleted? Annoying. At times, I may do some editing and IMovie projects for friends and their photo's may show up on my screen saver.  Want this to be more personal, pertaining to my family.  How do I accomplish this? Please, detail the procedure on doing the process if it can be done. Thanks.

    Welcome to Apple Support Communities. We're users here and don't speak for "Apple Inc."
    Here's how I do it:
    In iPhoto, I edit the images as necessary. Then I flag (Command + .) those images I want to use.
    They are automatically gathered into the 'Flagged' group under Recent within iPhoto.
    By flagging, I'm not limited to just selecting photos from a single event.
    When I've flagged all the images, (Command + .) I select the Flagged group and simply export the flagged photos I want to use into a Folder named 'Screen Saver Photos' on my desktop. (Original name, eh?) Then link to it from System Preferences, Screen Saver, Source:
    On a 500GB or 1TB drive, duplicating even a few hundred 5MB .jpg photos for this purpose isn't going to use much of the available space. When I'm ready for a new look, I delete the files in 'Screen Saver Photos' folder and start over once again.

  • How do I use contact groups to easily dial friends and fam

    Hi
    I set up groups (family/friends) in my address book MAINLY NOT to have to filter through every "Elizabeth" in my phone just to call my sister!  Now, although I have a group of family and friends set up, I cant figure out how to utilize them (the groups) to quickly dial them...?  If I type friends or family in the tool bar, nothing comes up.. or if I go to "Contacts" in my iphone (4S), tap the "Groups" button in the upper left corner, it brings me to a page listing 
    All iCloud
    Friends
    Family
    untitled groups etc..
    When I click on Family, it only "un checks" that group... ?
    I cannot locate the group for easy access anywhere I try and am hoping someone smarter can help me out ASAP!  I have just about given up on it, but it would make my life akabillion times easier as I am in sales and have akabillion and 5 clients in my phoe ...
      Thanks!
        ---Lost in Los Angeles

    hey thanks!
       ok, I did that... just realized that function .  But what about for a client list... (i seperate them by zip code).
    Do you know how I would do that? I literally have like, over 500... !  Would make it so easy to label the groups by zip so I can easily pull up thier call list.... I downloaded an app to try to help but it is even more confusing (I wish I were more technically educated, so sorry ...)
    But THANKS for getting back so quick

  • How to select the desired language in the item Startup and Login Windows?

    Users can individually select the language in which applications are displayed by moving the entries in the Language list of the International pane in System Preferences into the desired order. However, this language preference only affects applications started by each user, it does not apply to the startup phase of the operating system and its login window. Under normal circumstances, this kind of language preference can only be set when installing or reinstalling the operating system.
    How to modify this language preference without having to reinstall the system. Select the desired language in the item Startup and Login Language ?

    The language used by the login window is written in /Library/Preferences/.GlobalPreferences.plist. The file name begins with a dot . , so it is hidden in the Finder.
    If it is OK for you to use unix command line, then you can modify this plist file by using "defaults" command as follows (CAUTION! please be careful no to make any mistakes, and do it at your own risk).
    Open /Applications/Utilities/Terminal.app. and type
    cd /Library/Preferences
    cp .GlobalPreferences.plist saved-GlobalPreferences.plist
    to make a backup copy of the plist. (if you get permission error, then try
    sudo cp .GlobalPreferences.plist saved-GlobalPreferences.plist
    and enter the admin password.)
    Then type
    defaults read /Library/Preferences/.GlobalPreferences AppleLanguages
    to show the current setting. You can rearrange the list of languages as you like, for example,
    defaults write /Library/Preferences/.GlobalPreferences AppleLanguages '(fr en)'
    (or sudo defaults write .... if you get permission error)
    I think you may make the list as short as you like.
    If you don't like to use Terminal.app, then install Xcode (you can find it in Tiger install DVD, or download the latest version from Apple -- you need to register at Apple website to download it). It will install /Developer/Applications/Utilities/Property List Editor.app. You can edit /Library/Preferences/.GlobalPreferences.plist by this app by typing the following into Terminal.app (it's hidden in Finder so you must use Terminal.app to start editing it by Property List Editor):
    open /Library/Preferences/.GlobalPreferences.plist
    PowerMacG4, PowerBookG4, iMac(C2D)   Mac OS X (10.4.8)  

  • How to find the Org.key based on Job key and Org Unit.

    Hi,
      Please Let me know how to find the Org.Key based on the Job Key and org Unit.
    Regards
    nagendra.

    On recent ThinkPad, the Product ID Key sticker has been moved from the bottom of the unit to behind the battery.
    You need to contact Lenovo technical support directly to ask about recovery media.

  • How can I create a group email I can save and use again

    How can I created a group email to save and use again. I have an iPhone 4s.  ISO 8.2

    Olga, this is not a default feature in iPhone. You need a 3rd party application. I have created a free one, Easy Group, for group texting and group emailing.
    http://itunes.apple.com/fr/app/easy-group/id461469079?mt=8
    Rémi
    Note: I may receive some form of compensation, financial or otherwise,from my recommendation or link.

  • How do I unistall "inbox" from my Mac OS X and return soley to firefox?

    I installed "inbox" in hopes of getting better reception (without constant stop and go) of fox news. "inbox" however didn't improve anything; it only replaced my regular "Firefox" settings and my original internet search window. I want to uninstall "inbox" and return to my original "Firefox" settings. How can I get rid of "inbox"? "inbox" only gives instructions on how to uninstall it from a PC not from a Mac. Can you give me step by step instructions for Mac OS X?

    Written by Thomas Reed, a long time poster and the ‘expert’ on malware.
    Malware Guide – Adware – 10.6 and under

  • How to select a communication channel based on a field in the message?

    Hi All,
    In my scenario - Sending system will send one country field in the message ,I have one receiver system which has different folders for different countries.
    I have created separate communication channels for separate countries.
    Now at runtime based on the country field in sender message I need use the channel respective to that country.
    How should i achieve this?
    Please help.

    Hi,
    Say you have 3 countries - I would suggest:
    1) Create 3 services - each for one country
    2) Create 1 CC's under each of these services
    3) In your Receiver Determination ->Configured Receivers -> Condition field --- put in the condition (by choosing the field from the input that has the country code)
    4) Against each condition, choose the respective service for that country
    5) Complete the Interface Determination - (by calling the same mapping in all three Interface Determination)
    6) Complete the Receiver Agreement by choosing the appropriate CC created as in Step 2)
    1) and 2) are basically for ease of use. If you need to identify the Service or CC - this would be user-friendly.
    If you dont want to create 3 different services - you can still not do Step 1 and continue from Step 2.
    Regards,
    Balaji.M

  • How to select a different value based on $FLEX$ Value set

    Hi friends,
    am getting a column like position from positions_table....
    now based on this value set am selecting another column from the same table like for ex amount...using $FLEX$.vlaueset_name
    now if the value in the table is 0 or null I should make the field available for the user to enter something
    as of now it is not letting me enter any data as this value is based on the first value set we defined..
    is there a way to do that..
    hope am clear in specifying my requirement
    thanks

    Hi Balraj
    I want to select one list item value from yyy based on the xxx item value..Pls use the following andreas's link ( it's about it)
    http://andreas.weiden.orcl.over-blog.de/article-28957008.html
    pls study it carefully and develop.
    Hope it helps...
    Regards,
    Abdetu...

  • How to select a particular InfoProvider based on variable in BEx Query

    Hi,
       The MultiProvider is built on InfoProvider 1, 2 & 3 and a variable on 0CALMONTH. If the 0CALMONTH is CURRENT month then it should get the data from InfoProvider 1 & 3 only, otherwise it should be from InfoProvider 2 &3. How could I accomplish it, please?
    Thanks,
    Venkat.

    Hi Abhishek,
        Do I have to create a Customer Exit processing Type variable ZINFOPR for 0INFOPROV and User Entry Type variable ZCALMNTH for 0CALMONTH where the user enters the Cal Month? Do I have to write user exit like the below:
         WHEN 'ZINFOPR'.
        IF i_step = 2.                                  "after the popup
          LOOP AT i_t_var_range INTO loc_var_range
                  WHERE vnam = 'ZCALMNTH''.
            CLEAR l_s_range.
            CLEAR e_t_range.
            L_YEAR = sy-datum+0(4).
            L_MONTH = sy-datum+4(2).
            CONCATENATE L_YEAR L_MONTH INTO w_calmonth.
             l_s_range-sign     = 'I'.
             l_s_range-opt      = 'EQ'.
             l_s_range-high    = w_infoprov3.
             if  w_calmonth = loc_var_range-low+0(6).
                 l_s_range-low      = w_infoprov1.
            else.
                l_s_range-low      = w_infoprov2.
            endif.
              APPEND l_s_range TO e_t_range.
            EXIT.
          ENDLOOP.
        ENDIF.
       Could you please check and correct if it requires any changes.
    Thanks,
    Venkat.

  • How to select Certain TV shows to burn

    I've done this before- burning (for back up and play on authorized computers- NOT FOR DVD player) certain tv shows on a dvd- now I can't do it?
    For example- before I would download a whole season of Lost on a dvd- not problem. Today I tried to burn it and I can't- wants to burn the entire play list? Do I have to uncheck everything I don't want to burn? If so- is there an easier way to uncheck all of the shows-instead of individually unchecking everything? What a waste of time!!
    Any help would be great!!! I'm so fustrated right now!

    To uncheck (or check) everything at once, hold down the command key while clicking on one of the check boxes.

  • Group based on value range and order with in group

    Hi All,
    I have a scenario like to group record set based on a value set.
    Example.
    Table data_table has 10 columns of which one column grouping_col can have value from 10 - 100
    i have to retreive a report with multiple order by clause with a precondition that
    record having grouping_col having 10-50 should be processed first then,
    record having grouping_col having 50-60 should be processed next and then so on untill 100.
    Is there a way to do this without union funcitonality.

    Please read the SQL and PL/SQL FAQ:
    SQL and PL/SQL FAQ
    especially the second question regarding how to post a question on the forums.

  • How to conditional display Report Region based on number of rows returned

    I have a page with two Report Regions.
    One Region should display if the Query returns 0-1000 rows. The other should display if the same Query returns more than 1000 rows.
    The only way I can figure out how to do this is have ANOTHER query in the conditions field for each Region to Select count(*) from etc.
    I know there is a #TOTAL_ROWS# value but that is only available after the Region is displayed. Is there some other built-in variable that can be used to put in the Conditions field or is doing duplicate SQL queries the only way?
    Any help would be appreciated.

    Rather than running your query 4 times (by embedding it in your condition), you can have a region that is not displayed, with a hidden item, and set the value of the item in a before header computation to the count of your query. Now you can conditionally display based upon the value of that item.
    -- Sharon

  • How to save an XML file with a proper name and how to maintain the history?

    Hi All,
    As per the requirement, I have to remane the name of the XML file which is under the KM repository Userhome/personaldocuments based on the user logon information.
    I have created a Repository service for the same and following is the code for the same. The service is working, but only for the first entry in the XML form. Second onwards, the file does not get remaned to the preferred one.
    Request you to throw some light as what is wrong or missing in the code, so that I can follow the right approach. Many thanks in advance.
    // Code snippet is here//
    //Starts here//
    com.sap.security.api.IUser epUser;
                                            epUser = UMFactory.getAuthenticator().getLoggedInUser();
                                     String EntID = epUser.getUniqueName();
    IResourceContext resContext = null;
    try {
         resContext = ResourceFactory.getInstance().getServiceContext("cmadmin_service");
    } catch (ResourceException e1) {
              e1.printStackTrace();
    RID rid = RID.getRID("/userhome""/"EntID+"/Personal Documents");
    IResource resource = null;
    try {
         resource = (ResourceFactory.getInstance().getResource(rid, resContext));
    } catch (ResourceException e2) {
              e2.printStackTrace();
    ICollection collection = (ICollection)resource;
    IResourceList resourseList = null;
    try {
         resourseList = collection.getChildren();
    } catch (AccessDeniedException e3) {
              e3.printStackTrace();
    } catch (ResourceException e3) {
              e3.printStackTrace();
         for(int i=0;i<resourseList.size();i++){
              IResource res_new = resourseList.get(i);
                try {
                   res_new.rename("Address_new.xml");
              } catch (NotSupportedException e) {
                                  e.printStackTrace();
              } catch (AccessDeniedException e) {
                                  e.printStackTrace();
              } catch (ResourceException e) {
                                  e.printStackTrace();
    //Code ends here//
    Regards
    DK
    Edited by: DIPENDRA MOHANTY on Jun 5, 2009 5:20 PM

    Hi,
    The code seems ok.
    But you have mentioned about a KM Rep service, what service is that? which event it is listening to?
    Regards
    BP

Maybe you are looking for

  • LITE Bios Promise MSI 845PE MAX2 FIR

    Can any one tell me where I can find an update for the promise lite bios to the normal bios. I have 4 harddisks attached and I can only create 1 raid array. I would like to create a second on but the lite bios doesn't allow this. Thanks

  • SAP PRIMITIVE CONTROLS:  The Matrix Control

    SAP should definitely redefined this control.  To program this control is a logistical nightmare.  I'm really fed up with all this shortcomings.  Programming for SAP is like programming in a third generation language (or gui tools environment)    Que

  • Difference Between SAP Phone & ICI

    Hi All, We are planning to implement CRM IC WebClient using CRM 5.0. Currently we do not have any phone integration but we would like to consider doing so. Can somebody please explain me the difference between using SAPphone Vs using ICI? Irespective

  • "Buying" TV shows...

    IF I bought a season of Boston Legal (or any other series), would I "own" it or would I only have a 30 day viewing period before they went "poof" like the rental movies. Also, if I bought a series, could I sync it to my both my Apple TV and my IP?

  • Insert & update nested table

    Hi I have created one nested table with the follwing columns. I have to insert records into the nested table. And also I have to update the nested table. Please find below my table and getting error message. Please advose...!! SQL> create type detail