Relational to XML Question

I have a need to extract from a parent and 4 children tables and store the results in a clob field in another table. I have been going over the documentation and don't see a clear answer. I have tried using 'select xmlquery' and also 'Select dbms_xmlquery.getXML', but don't see an obvious answer to what I am trying to do. Can someone please provide a suggestion as what would be best for my scenario?
Thank you very much for your suggestion!
Jerry

One important piece of information - I using ver 10.2.0.3

Similar Messages

  • Where to ask XML-questions

    Hello,
    when I have a question about XML, where do I ask?
    XML DB issues related to XML DB
    XML  space for the following subspaces
    General XML  Discussion of the general XML language, standards (XSLT, XQuery, XMLSchema, etc.) and application management issues, suggestions and tips.
    PL/SQL XML Programming  PL/SQL programming using XDK and related management issues inside Oracle database server. Any question for XML DB functionality, please post your question in Products -> Database-> XML DB.
    XQuery Discussion of Oracle XQuery Technology Preview, W3C XQuery specifications, and JSR 225: XQuery API for Java (XQJ) issues
    I think I now have an idea (not that I'm sure about it) where my question will fit best. Now, because there is an explanation of the scope of the space, I don't remember something like this in the old forum. Nevertheless it might be confusing for a new member or one that lacks a certain knowledge about the subtleties:
    One step forward everyone who understands the explanation for the PL/SQL XML Programming space!
    When I have a question about XQuery, how can I decide whether XQuery is correct or General XML?
    Which questions qualify for XML DB and not for any of the others.
    We all know that many users are not able to see that SQL questions don't belong into the SQL Developer space, how can we expect that they will find the "correct" forum for XML questions? In the end they will end up in the SQL and PL/SQL space anyhow :-)
    Regards
    Marcus

    My $0.02.
    As I recall, the explanation for each forum was at the entry level for each forum and not displayed within the forum itself.
    The PL/SQL XML Programming space refers to the Oracle XML Developer Kit.  It is maintained by a different team than the XMLDB so the need for a separate space for it makes sense.  That said, what it covers is also part General XML and XQuery if you dig into what you can do in the XDK.
    Some questions that would qualify for the XML DB space.
    Anything related to schema registration or downstream of schema registration.  Such as querying/performance/indexes/etc.
    Issues parsing XML via using XMLTable (or XQuery, such as the new XQuery update added in 11.2.0.3) (Yes that can conflict)
    Storage of data in XMLType columns
    I to have always been a bit unclear on the exact division between groups in this XML space.  I see the XQuery space as being a subset of the General XML space.  I watch all three forums, as they are normally low volume and you never know where a question will pop up.  As you have seen, questions often end up in the wrong forum and often General XML gets an influx of questions that should go into the Business Intelligence space as well.  There is no good way right now to start a generic post and let the system suggest forums that the post could go into, based on content or software involved.  That would be a nice touch for the future.

  • Examples related to XML and XSLT

    Hello friends,
    In relation to XML and XSLT
    1. As I can transform an XML file using XSLT.
    2. I view the XML file using XSLT
    3. XSL and XSLT files are equal...?
    Thanks for the support

    http://docs.oracle.com/javaee/1.4/tutorial/doc/JAXPXSLT6.html

  • Best Practices - Relational to XML?

    Oracle 10gR2 Enterprise Edition 10.2.0.4.0
    Read the OpenWorld 2009 Oracle XML DB Design Guidelines, paraphrased as:
    - Use Case:
    -- Data already in relational form
    -- Need to generate different XML shape for presentation, exchange, reporting
    - Recommendations:
    -- Do Use XMLElement(), XMLForest(), XMLAgg() SQL/XML to define views
    -- Do Use XQuery with ora:view() for complex XML report generation
    -- Don't use use DBMS_XMLGEN(), DBMS_XMLQUERY(), XSU
    --- Lower perf, less declarative
    Although, Mark Drake's post in here Performance problems with XMLTABLE and XMLQUERY involving relational data has me wondering if the "Do Use XQuery with ora:view() for complex XML report generation" point has some caveats?
    I'm starting to build a solution to send relational data as XML to another system, where the relational data consists of several joined tables, including many one-to-one joins and a few one-to-many joins (including a pair of one-to-many joins where the rows from two joined tables must be interleaved). ( Note - To date, all of our XML processing has been for presentation and has been done on Windows .NET client apps. )
    Have built some simple SQL/XML views with XMLElement(), XMLAttributes(), XMLForest(), ... to begin building my SQL/XML and XML DB experience base, and am now working on an XQuery-based solution for the real solution.
    Questions:
    1. For performance with multiple 1:1 joined tables, should SQL VIEWs be preferred to building multiple FLOWR joins in XQuery?
    2. Can a relational tables with CLOB columns be referenced in the XQuery for clause of an SELECT XMLQuery() query?
    Note: Q2 is due to performance issues I encountered - when I added an XQuery for clause referencing a relational table containing several CLOB columns, the SELECT XMLQuery() query never returned.
    Alex

    stupid remark removed

  • Naive xml question

    hi,
    i'm new to xml and i need to create a data base in xml which is supposed to store patient records.
    The question is:
    Should all patient records be stored in the same file or should each patient record be stored in a different file?
    In the latter case how do we search for records given (for instance) the patient's name?
    Thanks,
    Nikolas.

    Hi pete,
    I see you know alot on the subject, what exaclty does your job entail? Does your company do any summer interships :-) ? Mehti & I are undergraduates in our second year of computer science at University College London and have been assigned this group project. Part of it involves making an xml "database" to store patient records for a phoney hospital system. From the requirements it would seem that an archive system would be preferable:
    Users, after identifying themselves, would retrieve files from the archive, edit them & replace them...
    In that respect, this isn't actually a relational database at all!
    >If you absolutely
    absolutely must only use XML, then you can create the
    index as an RDF/XML file and so query that. Since the
    records are simple files on the file system you may
    have more work to guarentee data integrity and
    security.
    This seems like what we would want to do. However what does an RDF/XML file look like? It indexes the paths to the files on the system right?
    > A compromise might be to use a CVS behind a web
    server to manage the access to the records- you can
    then fire a trigger on any updates to the record and
    re-index as required, and the interface is more
    secure.
    I personally don't have much experience with CVS (I do however have an idea about what it's about). However as it would definetly garantee the integrity of the file system we will try learning about it and find out how we could implement it.
    I think for the moment, we will satisfy ourselves with a repository of patient records as separate files and try to garantee security and integrity of the file system through CVS.
    Thanks Pete,
    Nikolas.

  • Follow-up Basic XML Questions

    First, I apologize to the board in advance because I started a very similar topic already. I know this can be annoying but I think I'm worried that people will ignore my original post because there was already a reply to it. I added 2 follow up posts and nobody has responded. It could well be because they feel that my questions were already answered. After reading and re-reading the person who replied to my original question I did start to pick up many answers from his post. However, I guess I have some follow-up questions and felt compelled to start a new thread to get this "out there" again. I promise to try not to do this again and, once again, I apologize for starting multiple similar topics. Anyway, here goes my follow-up questions...
    I'm pretty new to XML but I've been reading an article on msdn about it and listed some code from the article at the bottom of this post.
    I have some questions about namespaces. From what I understand, a namespace is a unique identifier (it's a string). The thing that's bugging me though is this line...
    <x:transform version='1.0' xmlns:x='http://www.w3.org/1999/XSL/Transform'>
    Maybe I'm wrong, but my gut feeling is that this particular namespace has a special meaning (in other words, it goes beyond being just a unique identifier). Am I correct on this?
    From other stuff I've read I have another gut feeling that there are certain namespaces that somehow have schemas attached to them automatically. I've read that a schema can be "namespace aware". So, as a guess at the answer to my original question - are there certain namespaces that are something like "keywords" (similar to the concept of "keywords" in programming languages)? And is the "big deal" about these particular namespaces that they have schema definitions attached to them somehow? Any help would be GREATLY appreciated!
    EXAMPLE CODE FROM THE MSDN SITE:
    <x:transform version='1.0'
    xmlns:x='http://www.w3.org/1999/XSL/Transform'
    >
    <x:template match='/'>
    <hello_world/>
    </x:template>
    </x:transform>

    this particular namespace has a special meaning .... Am I correct on this?Yes, that namespace has a "meaning", but only to a program that implements the XSLT language. Likewise a "purchase order" namespace has a "meaning", but only to a program that is designed to read XML with that namespace and convert it to purchase orders in somebody's accounting system. (Just as the codes 'A', 'C', and 'D' could mean 'Add', 'Change', and 'Delete' to a program that maintains a database.) Similarly element names have a "meaning", but only to a program that is designed to understand that "meaning". A Java program has a "meaning" but a COBOL compiler doesn't understand that "meaning".
    From other stuff I've read I have another gut feeling that there are certain namespaces that somehow have schemas attached to them automatically.Not that I've ever heard of.

  • XSLT, XML Question???

    I've recently found that I can use XSLT to transform XML docs into SQL using x-path... Is there any documentation out there referencing a transformation using x-query???? I've searched the web but have not seem much on this...
    Any direction would be greatly appreciated.

    XSLT doesn't use XQuery. So it's not surprising you haven't found much documentation about using XQuery in XSLT. You might want to direct questions like this one to an XSLT forum rather than a Java forum.

  • XMLTYPE variable converting to XML (Question)

    Friends,
    I am stuck on an error and cannot find a way out. Please help. I know it's a long question but a very simple answer to many smart people here. I am just lost and need your help. (I am new to SOA so bear with me)
    I have a BPEL process which invokes a PL/SQL API which returns the XMLTYPE output which has the XML data. In order to convert the XMLTYPE to normal XML I do following :-
    - I added a Java embed activity in BPEL with following code (Invoke_new_get_customer_order_info_OutputVariable','OutputParameters','/ns2:OutputParameters/ns2:X_CUSTOMER_ORDER_INFO_XML is the XMLTYPE)
    (responsePayoad is string variable)
    try{                                                           
    Node node = (Node)getVariableData("Invoke_new_get_customer_order_info_OutputVariable','OutputParameters','/ns2:OutputParameters/ns2:X_CUSTOMER_ORDER_INFO_XML");
    Node childNode = (Node) node.getFirstChild();
    StringWriter writer = new StringWriter();
    Transformer transformer = TransformerFactory.newInstance().newTransformer();
    transformer.transform(new DOMSource(childNode), new StreamResult(writer));
    String xml = writer.toString();
    String nsXML = xml.replaceFirst("<FetchCustomerInfoResponse","<FetchCustomerInfoResponse xmlns=\"http://xmlns.djoglobal.com/OrderTracking/CustomerInfo\" ");
    setVariableData("responsePayload",nsXML);
    addAuditTrailEntry("XML with Namespace: " + nsXML);
    } catch(Exception e){                            
    addAuditTrailEntry(e);
    System.out.println("Namespace injection failed due to : " + e);
    After above I have ASSIGN activity where I use parsexml function on the "responsePayload" variable to assign to a variable of type element which refers to following xsd. This is where I get an "internal xpath error" during runtime which I cannot resolve.
    XSD of the element variable refering to "FetchCustomerInfoResponse" element
    <?xml version="1.0" encoding="windows-1252" ?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns="http://www.example.org"
    targetNamespace="http://xmlns.djoglobal.com/OrderTracking/DJOFetchCustomerOrderInfo"
    elementFormDefault="qualified">
    <xsd:element name="FetchCustomerInfoResponse">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="DJO_ONT_ACCOUNT_ORDERS">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="DJO_ONT_ACCOUNT_ORDER" maxOccurs="unbounded">
    <xsd:complexType>
    <xsd:attribute name="ordered_date" type="xsd:string"/>
    <xsd:attribute name="cust_po_number" type="xsd:string"/>
    <xsd:attribute name="order_number" type="xsd:integer"/>
    <xsd:attribute name="header_id" type="xsd:integer"/>
    </xsd:complexType>
    </xsd:element>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:schema>
    XML returned in the XMLTYPE from the PL/SQL API :-
    <Invoke_new_get_customer_order_info_OutputVariable><part name="OutputParameters" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <OutputParameters xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.oracle.com/pcbpel/adapter/db/APPS/XXDJO_ONT_ORDER_TRACKING_WS/GET_CUSTOMER_ORDER_INFO_XML/"><X_CUSTOMER_ORDER_INFO_XML>
    <FetchCustomerInfoResponse xmlns="">
    <DJO_ONT_ACCOUNT_ORDERS>
    <DJO_ONT_ACCOUNT_ORDER ordered_date="24-APR-12" cust_po_number="PO1" order_number="123456" header_id="7777777"/>
    <DJO_ONT_ACCOUNT_ORDER ordered_date="19-APR-12" cust_po_number="PO2" order_number="4545454" header_id="888888"/>
    <DJO_ONT_ACCOUNT_ORDER ordered_date="09-APR-12" cust_po_number="PO3" order_number="56565656" header_id="999999"/>
    </FetchCustomerInfoResponse>
    </X_CUSTOMER_ORDER_INFO_XML>
    </OutputParameters></part></Invoke_new_get_customer_order_info_OutputVariable></messages>
    Any help is greatly appreciated as this is driving me nuts.
    Thanks

    Few modifications,
    1. Initialize your int count to 0, int count=0;
    2. Write count++; as the first statement in your for loop. 3. Remove count++; at the bottom.
    4. Add a hidden field to your form (after submit button, but before your </form> tag)
    <input type="hidden" name="qCount" value="<%=count%>">
    Now use this code,
    writeXML.jsp
    <%
    int qCount = Integer.parseInt(request.getParameter("qCount"));
    String home ="C:\\Tomcat\\FYProject\\lib\\";
    String filename = request.getParameter("file");
    String extension = ".xml";
    String filePath = home + filename + extension;
    BufferedWriter bw = new BufferedWriter(new FileWriter(filePath,true));
    bw.write("<mc_QuestionType>");
    bw.newLine();
    for(int count=0;count<qCount;count++) {
         String Tquestion = request.getParameter("questionText"+count);
         String answer1 = request.getParameter("choice_1"+count);
         String answer2 = request.getParameter("choice_2"+count);
         String answer3 = request.getParameter("choice_3"+count);
         String answer4 = request.getParameter("choice_4"+count);
         String Canswer = request.getParameter("cAnswer"+count);
         bw.write(" <questionText>" Tquestion "</questionText>");
         bw.newLine();
         bw.write(" <choice>" answer1 "</choice>");
         bw.newLine();
         bw.write(" <choice>" answer2 "</choice>");
         bw.newLine();
         bw.write(" <choice>" answer3 "</choice>");
         bw.newLine();
         bw.write(" <choice>" answer4 "</choice><br>");
         bw.newLine();
         bw.newLine();
         bw.write(" <answer>" Canswer "</answer>");
         bw.newLine();
         bw.write("</mc_QuestionType>");
         bw.close();
    %>Hope this works.
    Sudha

  • Sun-faces-config.xml question

    Hello all,
    maybe this question is a bit silly, but i�m a newbie to this. I�m developing a complib file with a custom component; and I want to add custom properties to it. As far as I�ve done, i�m able to add custom string properties via the "StringPropertyEditor"
    All this is done in the sun-faces-config.xml file, and when I declare a property which can be set via a combo-box, this is, with a "SelectOneDomainEditor" in the sun-faces-config.xml, I don�t know how to populate this combo with data to be shown so it can be selected in the properties window.
    I�d be truly grateful to anyone who can help me out, maybe a short sample or fraction of a sun-faces-config would be fine.
    Thanks everyone in advance, and sorry for the long read,
    MANUEL ANS�N.

    Hi ,
    The follwing link may probably answer your query.
    http://swforum.sun.com/jive/thread.jspa?threadID=50215&tstart=15
    Regards.,

  • Data Modeler: Relational data model questions

    1. Can a different notation be specified for relational data models' constraints? Specifically, I'd like crow's feet. BTW, the docs show crow's feet and parent pointer (with the arrowhead), but there's no such thing in the actual modeler.
    2. Is there any way to manually route FK constraints lines?
    3. When forward engineering from logical, is there any way to indicate the preferred name for keys and indexes (primary, unique, foreign)?
    4. Mandatory/optional indicator on tables: what exactly does 'N' or 'A' stand for? I can understand 'N' meaning "Not optional", but 'A'? Wouldn't it be simpler to use '*' and 'o' like in the logical?
    Man, do I ever miss Designer!
    Thanks,
    Patrick

    Here's one more question:
    I've transformed several super/sub entities to relational, and some of the tables do not allow me to open Properties (on the table). I can use the navigator to open column properties, but cannot open table properties (neither from diagrammer nor from navigator). Some of the tables are two or three subtype levels deep, and I haven't figured out why some open and some don't.

  • Oracle to xml question

    hi friends
    i have a oracle table for country,city,town.
    this table is like a tree
    and it has 5000+ rows and has relation with some other tables
    this datas fill into dropdown(combobox)if user select county from combobox1 ,combobox2 fill with this country's city and go on like this........
    if i try convert table's datas to xml file and do querry from xml file instead of oracle table
    do fill comboboxes work faster? or is it bad idea?

    Well since I don't have a clue how you access the XML files generated and don't know how you access the tables in Oracle I can't tell you anything about performance with that level of detailed information. Still your approach sounds strange to me.
    But what I can tell you is that I have doubts if you're understanding the implications of your current approach: If you're going to write to files in triggers then you might end up with files that are not consistent with the database content.
    What will happen if the transaction that modifies the table is going to be rolled back (for whatever reason, you're not in control of all possible eventualities)?
    Then you've written content to your file that doesn't reflect your database properly.
    Also note that DML operations in Oracle under certain circumstances perform a so called "restart", which means that triggers might fire several times for each row.
    A possible workaround for these issues is performing your non-transactional operation (send a mail, write to a file etc.) in job that is submitted in the trigger, because the job submit procedure is transactional and therefore is rolled back if a rollback occurs and therefore the job is never going to be executed in that case.
    You can find more information about that issue e.g. by Tom Kyte here:
    http://www.oracle.com/technology/oramag/oracle/08-jul/o48asktom.html
    Regards,
    Randolf
    Oracle related stuff blog:
    http://oracle-randolf.blogspot.com/
    SQLTools++ for Oracle:
    http://www.sqltools-plusplus.org:7676/
    http://sourceforge.net/projects/sqlt-pp/

  • Related to XML attributes

    now my xml.dtd file has the structure like this
    <!ATTLIST nete:forward
    filter CDATA #IMPLIED>
    that means that <nete:forward>element should contain one attribute....only....so in .xml file i can specify like<nete:forward filter="myfilter">........</nete:forward>
    now the requirement is ..it should support multiple attributes(infinite).......
    So instead of hard coding the dtd file like
    <!ATTLIST nete:forward
    filter CDATA #IMPLIED
    filter1 CDATA #IMPLIED
    filter2 CDATA #IMPLIED..........>
    .......Is there any way to specify ....to have multiple attributes for a element
    like
    <!ATTLIST nete:forward
    filter* CDATA #IMPLIED>
    so my final requirement is customer can add as many attributes he want like
    <nete:forward filter="xxx" filter1="yyy" filter2='zzz"........so on........</nete:forward>
    i think question is clear..........?

    I would expect element <nete:forward> to contain a set of <filter> elements rather than a set of filter attributes.

  • PMW - XML question

    Hello folks,
    we are currently working on the creation of an XML based payment medium.
    As far as I can see, the tags are generated automatically:
    <tag>content</tag>
    My question, I need to adapt the <tag> names as follows:
    <tag somefilename="xxxx.xml"></tag>
    I have the following problems: The file name should be automatically generated via document number or identifier (i.e. "1900000054.xml") which is changing for every transaction. Therefore, I need to have some sort of variable within the tag name. But it doesn't even allow me to enter a space within the name, so I guess I have to flag that tag differently.
    Is that at all possible? Otherwise we would need to switch back to a plain flat file and that's not a very nice solution.
    Many Thanks in advance for help/advice,
    Thomas

    Hello Thomas,
    what you are describing looks like an Attribute. Try to create an Attribute "Filename" under your Element "Tag". For the "Filename" you can then define any source again.
    Regards,
    Anton.

  • Spry XML question

    can spry read in XML as a string? I have an xml page
    generated by a coldfusion query (.cfm) The page parses correctly as
    an XML file, but when spry reads it in, it does not read it as XML.
    I can save the .cfm results (view source) as an XML file and it
    views perfectly through spry. Wondering if there is a way to do
    this with the original cfm file. NOTE: the example linked
    here
    does not work

    I use CF to generate XML all the time.
    You have to make sure you set the content-type to XML and
    make sure to remove whitespace:
    http://labs.adobe.com/technologies/spry/samples/utils/query2xml.html
    But to answer your questions: yes, Spry can read XML strings:
    http://labs.adobe.com/technologies/spry/samples/data_region/XMLStringSample.html
    Hope this helps.
    Don

  • FinalCut XML: question about the Center parameter

    Hi, I'm writing a script that will massage some of the data in the XML file export from a sequence. I'm trying to understand the settings for the Center parameter in the Viewer.
    If my Center point in the Viewer is 1 horizontal and 100 vertical, that corresponds to something like this in the XML:
    <name>Center</name>
    <keyframe>
        <when>147</when>
    <value>
        <horiz>0.000347222</horiz>
        <vert>0.0520833</vert>
    </value>
    </keyframe>
    Any idea how those horiz/vertical numbers correspond to the values 1 and 100?
    thanks,
    Scott

    Hi Meg, actually looking at this again I'm still confused. In my new sequence which is 1620x1080, I have vertical keyframes 0, 16, 34, 60, 79, 104 and 212. In my XML, these correspond to:
    0 : 0
    16 : <vert>0.00833333</vert>
    34 : <vert>0.0177083</vert>
    60: <vert>0.03125</vert>
    79: <vert>0.0411458</vert>
    104: <vert>0.0541667</vert>
    212: <vert>0.110417</vert>
    However, if I divide each of the left-hand values above by 1080, I get different numbers:
    16 / 1080 = .0148
    34 / 1080 = .0314
    60 / 1080 = .0555
    79 / 1080 = .0731
    104 / 1080 = .096
    212 / 1080 = .196
    So, I'm still not understanding where the <vert> numbers are coming from. Am I missing something? I understand the zero point is the center of the frame, so maybe that affects the calculations as well.
    As you can probably tell I'm trying to calculate the position of the same clip in the larger 1620x1080 frame, so it matches the relative position in the 720x480 frame. (I've changed the Scale by multiplying it by 2.25, which is easy.)
    I appreciate your help.
    Scott

Maybe you are looking for

  • Passing Bound values to templates containing choice tags

    I have a template which loads a DataObjectList into a <choice> tag. The values im passing in, to be used for the column name: are not being interperted correctly. The tag is using them as values to be rendered. i.e. 'output text'. The value are actua

  • Process for Annual Reports / Page Updates Etc....

    Whats the best way to get the text in a document that is 20+ pages with text and images, like an annual report? Should I link the whole WORD file? Make a WORD file for each page? I want my client to be able to easily make text changes and resend a wo

  • Printing extended ascii characters

    How can i print an extended ascii character through a java program if i know its ascii value?I tried this : for (int i=0;i<256;i++) System.out.print((char)i); and i got the character '?' printed on the console for some of the characters.

  • Logical error iExpenses

    There is a way to follow the details of each paguina Web within iExpenses, I have a logical error where I erased information already captured by pressing the button "Save" someone could mencionarme something. Thanks

  • Cache sequence

    Hi All, I have a straight insert/select - insert into t_tab (p_id, p_name, p_ser_id, p_flag) select my_seq.nextval, p_name, p_ser_id, p_flag from my_table The table my_table has about 500K records. It takes lot of time. Most time spent that sequence