logo

CuriousTab

CuriousTab

Discussion


Home Interview Technology Comments

  • Question
  • How do you load data from XML file to a ORACLE table?


  • Correct Answer
  • You need to first create a table in oracle that matches with the fields of the XML data So to get the XMl into the table, you can create a generic procedure that moves an XML document into a table by converting the elements to Oracle Canonical format Oracle Canonical format is as follows: ROW is used for the table names ROWSET is used for the XML document You can get the XML into the canonical form using XSL: < /ROW> To transform the XML document into the canonical form, you can write a procedure Make sure you include the line below in your procedure code: v_rows := DBMS_XMLStoreinsertXML( v_context, XMLTypetransform(p_xml_in, p_xsl_in)); The only remaining step is calling your procedure: DECLARE v_xml XMLType := XMLType( YOUR XML Document ); v_xsl XMLType := XMLType( YOUR XSL Document ); BEGIN procedure_name(v_xml, v_xsl, 'table_name'); END; 


  • Technology problems


    Search Results


    • 1. What is XML Namespace?
    • Discuss
    • 2. What is a CDATA section in XML?
    • Discuss
    • 3. What is XML?
    • Discuss
    • 4. What is Web Server?
    • Discuss
    • 5. What is Web Browser ?
    • Discuss
    • 6. How do you parse/validate the XML document?
    • Discuss
    • 7. What is XML template?
    • Discuss
    • 8. What is Xpath?
    • Discuss
    • 9. What is the use of FOR XML in SQL Server?
    • Discuss
    • 10. What is EXtensible Application Markup Language (XAML)?
    • Discuss


    Comments

    There are no comments.

Enter a new Comment