XMLAGG structure, performance need help for odd nesting in the schema

Hello

I have to produce XML to look like:
<?xml version='1.0'?>
  <enterprise>
    <membership>
      <sourcedid>
        <id>PHYS_101_001_FA2007</id>
      </sourcedid>
    <!-- NOTE: absence of "members" level tag for XMLAGG! -->
    <member>
      <sourcedid>
        <id>D2LU0001</id>
      </sourcedid>
      <role roletype="Sample Role">
        <status>1</status>
      </role>
    </member>
    <member>
      <sourcedid>
        <id>D2LU0002</id>
      </sourcedid>
      <role roletype="Sample Role">
        <status>1</status>
      </role>
    </member>
  </membership>
</enterprise>
It would be simple if the scheme allowed for a '< member >' tag under which fit the tags < member >. But it does not this tag, or any other than those listed above.

I have a query that does not produce this output (with the exception of the roletype attribute), but its execution is horrible; It takes about 40 minutes to return data:
SELECT
     XMLROOT(
         XMLELEMENT("enterprise",
           XMLAGG(
             XMLELEMENT("membership",
               XMLFOREST( XMLELEMENT("id",cx.mapped_course_id) as "sourcedid"
                        ),
               (SELECT XMLAGG(
                 XMLELEMENT("member",
                   XMLFOREST(XMLELEMENT("id",spriden_id) AS "sourcedid",
                             XMLELEMENT("status",'1') AS "role"
                             )
                       )
                      )
                  FROM enrollments_fall_sfrstca efs
                     , spriden sp
                     , gzv_tuid t
                 WHERE sp.spriden_change_ind IS NULL
                   AND sp.spriden_pidm       = t.pidm
                   AND t.tuid                = efs.user_name
                   AND efs.mapped_course_id  = cx.mapped_course_id
                   AND efs.term              = cx.semester
              )
                )
               )
              )
            , VERSION '1.0', STANDALONE NO VALUE)
  FROM courses_xt cx
WHERE cx.semester = :term_code
;
Similar queries produce classes and XML users very well without any performance problems, but these are driven out of the view of course or the sight of registrations, but not both.

Is there another way that I can produce the nesting that I need for the scheme the provider?

Source views are basically as follows (showing the relevant columns only):
courses_xt:
MAPPED_COURSE_ID       SEMEST
---------------------- ------
AVFT209-13307-201210   201210
AVFT210-13308-201210   201210
enrollments_fall_sfrstca:
MAPPED_COURSE_ID       USER_NAME
---------------------- ---------
AVFT209-13307-201210    FULLERC8
AVFT209-13307-201210    SHUPEK
AVFT209-13307-201210    NOMAN
AVFT210-13308-201210    SHUPEK
AVFT210-13308-201210    PELLONM
When I make the request without the XML (with subqueries as a column of the outer query), it returns the appropriate fast data (a few minutes).

I tried various permutations of XMLFOREST, XMLELEMENT, XMLAGG but I get a syntax error, or the data is not going (e.g. repeated "< membership >" for each "< member >", or should I create a "< member >" invalid tag filter later).

Please advise!

Thank you
Anita Lees

Hi Anita,.

Have you tried with a GROUP BY and any subquery?

Here is an example of the use of schema SCOTT.
I used the same names to tags and structure so that you can see the analogy:

SELECT XMLElement("enterprise",
         XMLAgg(
           XMLElement("membership",
             XMLElement("sourceid", xmlelement("id", d.deptno))
           , XMLAgg(
               XMLElement("member",
                 XMLElement("sourceid",
                   XMLElement("id", e.empno)
                 )
               , XMLElement("role",
                   XMLAttributes(e.job as "roletype")
                 , XMLElement("status", '1')
                 )
               )
             )
           )
         )
       )
FROM scott.dept d
     LEFT OUTER JOIN scott.emp e ON e.deptno = d.deptno
WHERE d.deptno IN (10,20)
GROUP BY d.deptno
;

What gives:


  
    
      10
    
    
      
        7782
      
      
        1
      
    
    
      
        7934
      
      
        1
      
    
    
      
        7839
      
      
        1
      
    
  
  
    
      20
    
    
      
        7369
      
      
        1
      
    
    
      
        7902
      
      
        1
      
    
    
      
        7566
      
      
        1
      
    
  

Tags: Oracle Development

Similar Questions

  • Need help for testing and practice the concepts of the server at home

    Original title: Hello team

    I need assistance with testing and to practice the concepts of the server at home... I don't have an option to test laboratory pls suggest possible ways that I can practice... need help... Please help

    Hi Sachinadi,

    You can ask your question in the MSDN Forums: http://msdn.microsoft.com/en-us/hh361695.aspx

    Thank you.

  • Need help for managed bean - to the values of the extraction of data loading of jsf is

    Hello
    in the construction of managed bean, I wrote code to extract values from database.

    but for each action (such as button clicks, drop-down list changes etc...) this constructor is called I don't want.

    I tried to over come this using beforePhase event of the jsf. but sometimes it doesn't property.

    Someone please help me to retrieve the values of data base loading of jsf is.

    Thank you
    Veera

    Veera
    If you want to execute a method in a method beforePhase only once (when loading the page) then you can check the expression #{adfFacesContext.initialRender} before running all you want.

    import javax.el.ELContext;
    import javax.el.ExpressionFactory;
    import javax.el.ValueExpression;
    import javax.faces.application.Application;
    import javax.faces.context.FacesContext;
    import javax.faces.event.PhaseEvent;
    
    public class Test {
    
        public boolean isInitialrender() {
            FacesContext fctx = FacesContext.getCurrentInstance();
            Application application = fctx.getApplication();
            ExpressionFactory expressionFactory =
                application.getExpressionFactory();
            ELContext context = fctx.getELContext();
            ValueExpression createValueExpression =
                expressionFactory.createValueExpression(context,
                                                        "#{adfFacesContext.initialRender}",
                                                        Object.class);
            Boolean isInitialrender =
                (Boolean)createValueExpression.getValue(context);
            return isInitialrender;
    
        }
    
        public void beforePhaseMethod(PhaseEvent phaseEvent) {
            // Add event code here...
            if (isInitialrender()) {
                System.out.println("This statement is shown once... when the page is loaded");
            }
        }
    }
    
  • Windows error need help for files saved in the desktop computer

    After that I scanned my PC with AVG Antivirs, my OS was wrecked because of some virus, well I was able to recover the windows and she got up but all my files saved on the desktop are gone? How can I recover these files, the office very important = btw ()

    Hello

    Step 1: Make sure these files are hidden.

    Step 2: Use windows search to search for the missing files.

    Step 3: You can also check if you can see the files in safe mode and after the same return.

  • I need help for iPad Dimensions of the landscape.

    I was on it for a bit, going to have to rethink my app to fit the dimensions of the iPad, and it's driving me crazy!
    Can someone tell me what must be paid for Stadium iPad?
    I've implemented a new AS3 project in Flash AS3 - stage size: 1024 x 768
    Settings - Air for iOS, image format - landscape, rendered - CPU, resolution - Standard of publication.
    However, when I publish and deploy the application on the iPad, I get 2 white bars (stadium is white) on each side in landscape orientation. It comes to 50px wide.

    What I'm doing wrong here. If I resize my content we will tell, 1156 * 768, the content fills the screen.

    Every book, blog, and forum always publishes 1024 x 768. I'm following the iOS of the e-book 'Development with Flash®.

    Has anyone experience this problem with the iPad 1 or 2?
    (I use an iPad with iOS 1? 4.3.1 to test with)

    1024 * 768 is fine and also use code followiing all-in-package and publish it in full screen and uncheck the autoorient property.

    this.stage.scaleMode = StageScaleMode.NO_SCALE;
    This.stage.Align = StageAlign.TOP_LEFT;

  • Need help for optical safety circuit.

    I buy these parts and prototype with real components, but since I multisim, I thought it would be nice to create the circuit and maybe work through issues I can practically.

    I need a circuit that takes 120 VCA, generates 5 VDC and 1.5Vdc power of optical transmitter and receiver.  I actually use a data port because he has great range and is pretty cheap.  Rather than send the binary code well I just send a light stead that is broken or not broken through doors and windows in my house.  Then the receiver sees this as an entry and order a relay.

    I tried several voltage regulators that come with multisim, but I get an error of execution of my circuit.  Really I can't the 120 VAC to power levels necessary for the functioning of the optics.

    Otherwise I might want to run on a system 120Vdc with battery backup, so throw a 120Vdc up to 20 v DC switching power supply - but I have not found a SMP in the library which takes 120 as input and as output 20.

    Basic plan: 120VAC source-> transform to 24Vac-> Full bridge rectifier to ~ 20 v DC-> voltage capacitor filter on the input of two voltage regulators (1 to 5 VDC, 1 to 1.5Vdc) - then circuit since the two power supply of the transmitter and the receiver.

    I just need help for 5V and 1.5V, from there, I know that the real world circuit will work component tests already carried out.  Thanks for reading.

    I didn't Multism so I can't advise you on the compatible models. I ran the model on semiconductors with slight modifications of format on my SPICE simulator based on Berkeley Spice 3f5. I had to change the format of model resistance semiconductors appeal but has not changed any values.

    The output of your power supply circuit 3 (with 5 V, not the 1.5 V regulator regulator) was 4.99995 V.

    There are a few messages about changing templates published for compatibility Multisim woth. You can search those to see if there are any suggestions on what you'll need to fix in the model.

    Lynn

  • I need help for the upgrade of my current system.

    I need help for the upgrade of my current system.

    I have SBS 2008 with (Exch 2007, SQL 2005, Sharepoint, backupexec 2010 for sbs) licenses.

    I want to make the larger environment using the following:

    (1) apply Virtualization

    (2) apply to the failover process (clustering)

    "(3) the environment must support adding server terminal server, ERP server, exchange server, domain controller, backup manager.

    Storage 4) that supports Raid (1 and 5)

    UTM excellent 6) that supports (SSL VPN, VPN Global)

    suitable backup solution 7)

    (8) good antivirus for clients

    my questions:

    (1) can you provide me with a good design for this environment

    (2) should I choose what operating system:

    Microsoft datacenter or company

    I know datacenter provide us the unlimited VM but needs per processor license

    so if I have two Grouped servers I want to buy 4 licenses

    and just 4 VMs per company license... to say that we have two servers and maintain 8 vms so wat happened if 1 goes down... How can I migrate the 4 virtual machines on the server failed to another server group... ? should I buy enterprise license?

    (3) if I get the SAN storage for data... How can I save this storage... should I get another SAN?

    (4) how can I upgrade SBS stad single server (windows standrad) without losing the licenses as Exch 2007, SQL 2005, sharepoint.is it a must to buy an edition full std server or there is a way to upgrade (license wise, I mean)?

    (5) what about win2k8 license for VM:

    lets say we have physical that has windows license so that enough to have windows for VM or should I buy windows for VM licenses?

    (6) can I use backExec license for SBS with windows 2008 standard

    (7) who better to virtualization AMD or INTEL

    (8) hyper V or VMware?

    (9) what of Microsoft data protection Manager... is this good?

    (10) what virtual machine manager? What are the benefites keys

    Thanks in advance

    Hello AnasAI,

    You can find the Server forums on TechNet support, please create a new post at the following link:

    http://social.technet.Microsoft.com/forums/en/category/WindowsServer/

  • Need help to find and install the game Chess Titans Windows Vista for XP

    Need help to find and install the game Chess Titans Windows Vista for XP

    Hi SBOYDC130guy,

    We will not be able to install titan of failures on windows XP because it is designed for Windows Vista and Windows 7 and it's built-in game.

    With regard to:

    Samhrutha G S - Microsoft technical support.

    Visit our Microsoft answers feedback Forum and let us know what you think.

  • I need help for activation of the real administrator account.

    I have a problem with Adobe reader 9 standard, Adobe customer service asked the unhide real administrator account before you can continue to help me.

    I need help for that.

    http://www.Vistax64.com/tutorials/67567-administrator-account.html

    http://www.howtogeek.com/HOWTO/Windows-Vista/enable-the-hidden-administrator-account-on-Windows-Vista/

    Read the above info.

    See you soon. Mick Murphy - Microsoft partner

  • I need help for my reader to USB drive on my windows 10 ACER?

    I need help for my reader to USB stick on my chrome windows 10 plug ins acer. Can you help me?

    What Adobe application that you use?

    This is the Adobe Media Encoder forum, and you did not mention anything on this subject. If you can let us know what Adobe application, you need help, we can help you make the right forum.

    Thank you

    Regalo

  • Hello, I need help for cancel the payment on my adobe account.

    Hello, I need help for cancel the payment on my adobe account. I'm from Peru, Im paying a monthly fee as a student. Help, please...

    Cancel your membership creative cloud

  • Hello, need help for Adobe Reader DC playing animation files that are specified in the pdf output by script Latex Beamer. My Adobe Reader DC refuse to open any format that I gave him.  Thank you very much

    Hello, need help for Adobe Reader DC playing animation files that are specified in the pdf output by script Latex Beamer. My Adobe Reader DC refuse to open any format that I gave him.  Thank you very much

    Hey ihorl18351266,

    Please note that you can open PDF files using only the CD player. Any other format will not be supported by the software.

    Kind regards

    Ana Maria

  • Need help for upgrade R2 of Alienware x 51: card graphics, RAM, power supply

    Hi, about a year ago, I purchased the Alienware R2 x 51, and I want to improve.

    Im a bit new to this so I need help, so I came on the forums.

    Current form (these are the parts I want to improve):

    GeForce® GTX 745 with 4 GB of DDR3 memory

    3.4 GHz Intel Core i7-4770 processor

    8 GB OF DDR3 MEMORY

    You want to upgrade to these parts:

    GTX 960

    16 GB OF DDR3 MEMORY

    I'm not sure things:

    -I don't know if I currently have a 330w power, I heard say that because I have the R2 version of the x 51 Alienware, I 330w power (but I'm not sure so if someone can help with this, or tell me how do I know if I have a 330w PSU)

    -Ive seen someone use this card with his alienware x 51 and it worked perfectly and I was wondering if it would work with my alienware too

    www.Amazon.com/.../Ref=sr_1_5, qid = 1437994445 & sr = 8-5 & keywords = gtx + 960 + msi

    • This card will fit in my alienware x 51?
    • It will run smoothly?

    -Last thing is I need help with the ram, I want to buy two 8 GB sticks and replace them with two 4 GB ones I currently have. I'm not sure which RAM should I get (if someone can help with this and leave a link) which is compatible with my x 51 alienware.

    If you had something but the 645 GTX, GTX 745 or GTX 750 ti, you 330w POWER supply. The PSU is determined by what GPU, you, you no what revision. If you want to upgrade to the GTX 960 (the one you accessed is good), you must supply 330w (what I describe as a big black brick with an oval green LED). You probably have the 240w.

    Most desktop DDR3 RAM should work with the X 51. Some will not be because they do not match (heat sink (?) too thick and rounded).

  • I need help on creating reports on the intranet.

    I need help on creating reports on the intranet.
    My level: Beginner cf.
    Y at - it a book for report design? And structures for reports?
    ------------------------------------------------requirements
    my form needs one

    · Date of the box you want. (from and to).
    · Option button to choose the csv and html
    · Run and throw out the results in a tabular format. (grids, cell)


    How many cfm pages do need me for this? E.g. display, action.
    What called what?
    What else do I need?

    I suggest that you put your project on hold for a little everything and get and read the chapters appropriate Web Application Construction Kit of Ben Forta. You can learn more about it here - http://www.forta.com/books/0321223675/. Once you have the concepts down, you will have a much more concentrated idea on what to do.

  • I need help [bought showing program as the trial]

    with my photoshop, because I paid 275 for 1 year. In creative cloud, I read rest 30 days

    [Title edited for clarity... MOD]

    Your subscription to cloud shows correctly on your account page?

    If you have more than one email, you will be sure that you use the right Adobe ID?

    https://www.adobe.com/account.html for subscriptions on your page from Adobe

    .

    If Yes

    Sign out of your account of cloud... Restart your computer... Connect to your paid account of cloud

    -Connect using http://helpx.adobe.com/x-productkb/policy-pricing/account-password-sign-faq.html

    -http://helpx.adobe.com/creative-cloud/kb/sign-in-out-creative-cloud-desktop-app.html

    -http://helpx.adobe.com/x-productkb/policy-pricing/activation-network-issues.html

    -http://helpx.adobe.com/creative-suite/kb/trial--1-launch.html

    -ID help https://helpx.adobe.com/contact.html?step=ZNA_id-signing_stillNeedHelp

    -http://helpx.adobe.com/creative-cloud/kb/license-this-software.html

    .

    If no

    This is an open forum, Adobe support... you need Adobe personnel to help

    Adobe contact information - http://helpx.adobe.com/contact.html

    Chat/phone: Mon - Fri 05:00-19:00 (US Pacific Time)<=== note="" days="" and="">

    -Select your product and what you need help with

    -Click on the blue box "still need help? Contact us. "

Maybe you are looking for