XML doc into Database?

I was given a large xml document (300pgs), and I'd like to
get all fo that data into an Access DB. Can anyone tell me if this
is possible and give me some hints. I know Access is not preferred,
but the client has set specifications.
Thanks,
Stephen

"sbsmithfl" <[email protected]> wrote in
message
news:fi15g6$dog$[email protected]..
>
> I was given a large xml document (300pgs), and I'd like
to get all fo
> that
> data into an Access DB. Can anyone tell me if this is
possible and give
> me
> some hints. I know Access is not preferred, but the
client has set
> specifications.
>
> Thanks,
> Stephen
Create the database structure to contain the XML data, then
transform it
into SQL using a XSL Stylesheet,
then execute the resulting SQL in your database.
The catch is you may need to escape certain characters that
have special
meaning in SQL
<xsl:stylesheet version="1.0"
xmlns:xsl="
http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" indent="yes"
omit-xml-declaration="yes" media-type="text/plain"/>
<xsl:template match="/">
<xsl:apply-templates select="*" />
</xsl:template>
<xsl:template match="product">
INSERT INTO product(title,description,price)
VALUES('<xsl:value-of
select="title"/>','<xsl:value-of
select="description"/>', '<xsl:value-of
select="price"/>');
</xsl:template>
<!-- ignore unhandled -->
<xsl:template match="*|@*|text()"></xsl:template>
</xsl:stylesheet>

Similar Messages

  • Error While Loading XMl Doc into Oracle Database 10g

    Hi all,
    I have a task that , I have to make a utillity by which we can load XML Doc into a Table. While searching on Internet i found following Procedure on ASK Tom
    CREATE OR REPLACE
    procedure insert_xml_emps(
    p_directory in varchar2, p_filename in varchar2, vtableName in varchar2 )
    as
    v_filelocator bfile;
    v_cloblocator clob;
    l_ctx dbms_xmlsave.ctxType;
    l_rows number;
    begin
    dbms_lob.createtemporary(v_cloblocator,true);
    v_filelocator := bfilename(p_directory, p_filename);
    dbms_lob.open(v_filelocator, dbms_lob.file_readonly);
    DBMS_LOB.LOADFROMFILE(v_cloblocator, v_filelocator,
    dbms_lob.getlength(v_filelocator));
    l_ctx := dbms_xmlsave.newContext(vTableName);
    l_rows := dbms_xmlsave.insertxml(l_ctx,v_cloblocator);
    dbms_xmlsave.closeContext(l_ctx);
    dbms_output.put_line(l_rows || ' rows inserted...');
    dbms_lob.close(v_filelocator);
    DBMS_LOB.FREETEMPORARY(v_cloblocator);
    end ;
    when i try to run this procedure
    BEGIN
    insert_xml_emps('XML_LOAD','load.xml','IBSCOLYTD');
    END;
    it gaves me following Error
    ORA-29532: java call terminated by uncaught java exception : Oracle.xml.sql.OracleXMLSQLException:No
    rows to modify-- the row enclosing tag missing. Specify the correct row enclosing tag.
    ORA-06512: at "SYS.DBMS_XMLSAVE", line 115
    ORA-06512: at "EXT_TEST.INSERT_XML_EMPS", line 18
    ORA-06512: at line 2
    Can anyone describe me this error
    Thanks.
    Best Regards.

    SQL> /* Creating Your table */
    SQL> CREATE TABLE IBSCOLYTD
      2  (
      3  ACTNOI VARCHAR2 (8),
      4  MEMONOI NUMBER (7,0),
      5  MEMODTEI DATE,
      6  AMOUNTI NUMBER (8,0),
      7  BRCDSI NUMBER (4,0),
      8  TYPEI NUMBER (4,0),
      9  TRANSMONI NUMBER (6,0)
    10  );
    Table created.
    SQL> CREATE OR REPLACE PROCEDURE insert_xml_emps(p_directory in varchar2,
      2                                              p_filename  in varchar2,
      3                                              vtableName  in varchar2) as
      4    v_filelocator    BFILE;
      5    v_cloblocator    CLOB;
      6    l_ctx            DBMS_XMLSTORE.CTXTYPE;
      7    l_rows           NUMBER;
      8    v_amount_to_load NUMBER;
      9    dest_offset      NUMBER := 1;
    10    src_offset       NUMBER := 1;
    11    lang_context     NUMBER := DBMS_LOB.DEFAULT_LANG_CTX;
    12    warning          NUMBER;
    13  BEGIN
    14    dbms_lob.createtemporary(v_cloblocator, true);
    15    v_filelocator := bfilename(p_directory, p_filename);
    16    dbms_lob.open(v_filelocator, dbms_lob.file_readonly);
    17    v_amount_to_load := DBMS_LOB.getlength(v_filelocator);
    18    ---  ***This line is changed*** ---
    19    DBMS_LOB.LOADCLOBFROMFILE(v_cloblocator,
    20                              v_filelocator,
    21                              v_amount_to_load,
    22                              dest_offset,
    23                              src_offset,
    24                              0,
    25                              lang_context,
    26                              warning);
    27 
    28    l_ctx := DBMS_XMLSTORE.newContext(vTableName);
    29    DBMS_XMLSTORE.setRowTag(l_ctx, 'ROWSET');
    30    DBMS_XMLSTORE.setRowTag(l_ctx, 'IBSCOLYTD');
    31    -- clear the update settings
    32    DBMS_XMLStore.clearUpdateColumnList(l_ctx);
    33    -- set the columns to be updated as a list of values
    34    DBMS_XMLStore.setUpdateColumn(l_ctx, 'ACTNOI');
    35    DBMS_XMLStore.setUpdateColumn(l_ctx, 'MEMONOI');
    36    DBMS_XMLStore.setUpdatecolumn(l_ctx, 'MEMODTEI');
    37    DBMS_XMLStore.setUpdatecolumn(l_ctx, 'AMOUNTI');
    38    DBMS_XMLStore.setUpdatecolumn(l_ctx, 'BRCDSI');
    39    DBMS_XMLStore.setUpdatecolumn(l_ctx, 'TYPEI');
    40    DBMS_XMLStore.setUpdatecolumn(l_ctx, 'TRANSMONI');
    41    -- Now insert the doc.
    42    l_rows := DBMS_XMLSTORE.insertxml(l_ctx, v_cloblocator);
    43    DBMS_XMLSTORE.closeContext(l_ctx);
    44    dbms_output.put_line(l_rows || ' rows inserted...');
    45    dbms_lob.close(v_filelocator);
    46    DBMS_LOB.FREETEMPORARY(v_cloblocator);
    47  END;
    48  /
    Procedure created.
    SQL> BEGIN
      2  insert_xml_emps('TEST_DIR','load.xml','IBSCOLYTD');
      3  END;
      4  /
    PL/SQL procedure successfully completed.
    SQL> SELECT * FROM ibscolytd;
    ACTNOI      MEMONOI MEMODTEI     AMOUNTI     BRCDSI      TYPEI  TRANSMONI
    28004125     251942 05-SEP-92        400        513          1          0
    28004125     251943 04-OCT-92        400        513          1          0
    SQL>

  • Problem inserting xml doc into tables

    I'm trying to load and xml doc into a table/columns using putXML. I clearly have elements in my xml doc that I do not want to load into the table. I am receiving the following error: The XML element tag 'VERB' does not match the name of any of the columns/attributes of the target database. I'm having difficulty figuring out how to exclude of ignore these elements.
    Any help would be greatly appreciated.
    Thanks,
    John

    Hi,
    How about applying an XSL on the existing XML doc to create another XML doc to filter out the table column not found in the target db table, so that all the columns are matched and then use putXML to load?
    Hope that helps.
    OTN team@IDC

  • Loading XML files into Database table

    Loading XML files into Database table
    Hi I have some XML files say 100 files in a virtual directory created using &quot;Create or replace directory command&quot; and those files need to be loaded into a table having a column of XMLTYPE. 1)How to load that using Oracle provided procedures/packages

    Check out the Oracle XDB Developer's Guide, Chapter 3. There is an example of using BFileName function to load the xml files from a directory object created using create or replace directory. It works really well.
    Ben

  • Read XML file into databased using stored procedure

    I need to read an xml file into my database using a stored procedure. I looked at a couple of tutorials, but I am kind of lost and am looking for some guidance. I will eventually need to only pull a handfull of the data in based on the USER ID. Any help will be greatly appreciated. I have been given a schema file and an example file of how the data will me sent to me. The schema file is below:
    <h1>Schema File</h1>
    <?xml version="1.0" encoding="utf-8"?>
    <!--Generated by Turbo XML 2.4.1.100. Conforms to w3c http://www.w3.org/2001/XMLSchema-->
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
    <xsd:element name="root">
    <xsd:complexType />
    </xsd:element>
    <xsd:element name="Report">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element ref="Biller" />
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    <xsd:element name="Biller">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element ref="BillerName" />
    <xsd:element ref="BillerIdNumber" />
    <xsd:element ref="PartnerInfo" />
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    <xsd:element name="BillerName">
    <xsd:complexType mixed="true">
    <xsd:choice />
    </xsd:complexType>
    </xsd:element>
    <xsd:element name="BillerIdNumber">
    <xsd:complexType mixed="true">
    <xsd:choice />
    </xsd:complexType>
    </xsd:element>
    <xsd:element name="PartnerInfo">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element ref="PartnerName" />
    <xsd:element ref="PartnerVenderNumber" />
    <xsd:element ref="PartnerStreet01" />
    <xsd:element ref="PartnerStreet02" />
    <xsd:element ref="PartnerCity" />
    <xsd:element ref="PartnerState" />
    <xsd:element ref="PartnerZip" />
    <xsd:element ref="PartnerCountry" />
    <xsd:element ref="PartnerActive" />
    <xsd:element ref="PartnerContactName" />
    <xsd:element ref="PartnerEmailAddress" />
    <xsd:element ref="PartnerContactPhone" />
    <xsd:element ref="PartnerFaxNumber" />
    <xsd:element ref="PartnerUpdateUser" />
    <xsd:element ref="PartnerUpdateDate" />
    <xsd:element ref="PartnerDocColor" />
    <xsd:element ref="PartnerDocDistribution" />
    <xsd:element ref="PartnerDocPrinting" />
    <xsd:element ref="PartnerDocTiming" />
    <xsd:element ref="Delivery" maxOccurs="unbounded" />
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    <xsd:element name="PartnerName">
    <xsd:complexType mixed="true">
    <xsd:choice />
    </xsd:complexType>
    </xsd:element>
    <xsd:element name="PartnerVenderNumber">
    <xsd:complexType mixed="true">
    <xsd:choice />
    </xsd:complexType>
    </xsd:element>
    <xsd:element name="PartnerStreet01">
    <xsd:complexType />
    </xsd:element>
    <xsd:element name="PartnerStreet02">
    <xsd:complexType />
    </xsd:element>
    <xsd:element name="PartnerCity">
    <xsd:complexType />
    </xsd:element>
    <xsd:element name="PartnerState">
    <xsd:complexType />
    </xsd:element>
    <xsd:element name="PartnerZip">
    <xsd:complexType />
    </xsd:element>
    <xsd:element name="PartnerCountry">
    <xsd:complexType />
    </xsd:element>
    <xsd:element name="PartnerActive">
    <xsd:complexType />
    </xsd:element>
    <xsd:element name="PartnerContactName">
    <xsd:complexType />
    </xsd:element>
    <xsd:element name="PartnerEmailAddress">
    <xsd:complexType />
    </xsd:element>
    <xsd:element name="PartnerContactPhone">
    <xsd:complexType />
    </xsd:element>
    <xsd:element name="PartnerFaxNumber">
    <xsd:complexType />
    </xsd:element>
    <xsd:element name="PartnerUpdateUser">
    <xsd:complexType />
    </xsd:element>
    <xsd:element name="PartnerUpdateDate">
    <xsd:complexType />
    </xsd:element>
    <xsd:element name="PartnerDocColor">
    <xsd:complexType />
    </xsd:element>
    <xsd:element name="PartnerDocDistribution">
    <xsd:complexType />
    </xsd:element>
    <xsd:element name="PartnerDocPrinting">
    <xsd:complexType />
    </xsd:element>
    <xsd:element name="PartnerDocTiming">
    <xsd:complexType />
    </xsd:element>
    <xsd:element name="Delivery">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element ref="DeliveryType" />
    <xsd:element ref="DeliveryContactName" />
    <xsd:choice>
    <xsd:element ref="ReceivingStreet01" />
    <xsd:element ref="ReceivingStreet02" />
    <xsd:element ref="ReceivingCity" />
    <xsd:element ref="ReceivingState" />
    <xsd:element ref="ReceivingZip" />
    <xsd:element ref="ReceivingCountry" />
    <xsd:element ref="DeliveryEmailAddress" />
    <xsd:element ref="DeliveryCompanyId" />
    <xsd:element ref="DeliveryUserId" />
    <xsd:element ref="DeliveryFormatType" />
    <xsd:element ref="SecureType" />
    <xsd:element ref="SecureQuestion" />
    <xsd:element ref="SecureAnswer" />
    <xsd:element ref="DeliveryFaxNumber" />
    </xsd:choice>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    <xsd:element name="DeliveryType">
    <xsd:complexType mixed="true">
    <xsd:choice />
    </xsd:complexType>
    </xsd:element>
    <xsd:element name="DeliveryContactName">
    <xsd:complexType mixed="true">
    <xsd:choice />
    </xsd:complexType>
    </xsd:element>
    <xsd:element name="DeliveryEmailAddress">
    <xsd:complexType mixed="true">
    <xsd:choice />
    </xsd:complexType>
    </xsd:element>
    <xsd:element name="SecureType">
    <xsd:complexType />
    </xsd:element>
    <xsd:element name="SecureQuestion">
    <xsd:complexType mixed="true">
    <xsd:choice />
    </xsd:complexType>
    </xsd:element>
    <xsd:element name="SecureAnswer">
    <xsd:complexType mixed="true">
    <xsd:choice />
    </xsd:complexType>
    </xsd:element>
    <xsd:element name="DeliveryFormatType">
    <xsd:complexType mixed="true">
    <xsd:choice />
    </xsd:complexType>
    </xsd:element>
    <xsd:element name="DeliveryCompanyId">
    <xsd:complexType mixed="true">
    <xsd:choice />
    </xsd:complexType>
    </xsd:element>
    <xsd:element name="DeliveryUserId">
    <xsd:complexType mixed="true">
    <xsd:choice />
    </xsd:complexType>
    </xsd:element>
    <xsd:element name="DeliveryFaxNumber">
    <xsd:complexType mixed="true">
    <xsd:choice />
    </xsd:complexType>
    </xsd:element>
    <xsd:element name="ReceivingStreet01">
    <xsd:complexType mixed="true">
    <xsd:choice />
    </xsd:complexType>
    </xsd:element>
    <xsd:element name="ReceivingStreet02">
    <xsd:complexType />
    </xsd:element>
    <xsd:element name="ReceivingCity">
    <xsd:complexType mixed="true">
    <xsd:choice />
    </xsd:complexType>
    </xsd:element>
    <xsd:element name="ReceivingState">
    <xsd:complexType mixed="true">
    <xsd:choice />
    </xsd:complexType>
    </xsd:element>
    <xsd:element name="ReceivingZip">
    <xsd:complexType mixed="true">
    <xsd:choice />
    </xsd:complexType>
    </xsd:element>
    <xsd:element name="ReceivingCountry">
    <xsd:complexType mixed="true">
    <xsd:choice />
    </xsd:complexType>
    </xsd:element>
    </xsd:schema>
    <h1>Example File</h1>
    <?xml version="1.0" encoding="utf-8"?>
    <Report>
    <Biller>
    <BillerName>DONATO TEST BILLER</BillerName>
    <BillerIdNumber>999999999</BillerIdNumber>
    <PartnerInfo>
    <PartnerName>TEST TRADING PARTNER</PartnerName>
    <PartnerVenderNumber>999999999</PartnerVenderNumber>
    <PartnerStreet01 />
    <PartnerStreet02 />
    <PartnerCity />
    <PartnerState />
    <PartnerZip />
    <PartnerCountry />
    <PartnerActive />
    <PartnerContactName />
    <PartnerEmailAddress />
    <PartnerContactPhone />
    <PartnerFaxNumber />
    <PartnerUpdateUser />
    <PartnerUpdateDate />
    <PartnerDocColor />
    <PartnerDocDistribution />
    <PartnerDocPrinting />
    <PartnerDocTiming />
    <Delivery>
    <DeliveryType>EMAIL</DeliveryType>
    <DeliveryContactName>Kiran</DeliveryContactName>
    <DeliveryEmailAddress>[email protected]</DeliveryEmailAddress>
    </Delivery>
    <Delivery>
    <DeliveryType>SECURE</DeliveryType>
    <DeliveryContactName />
    <DeliveryEmailAddress>[email protected]</DeliveryEmailAddress>
    <SecureType />
    <SecureQuestion>Pet Name</SecureQuestion>
    <SecureAnswer>040698de9bf14ef87d8cbaf46b8ecddc</SecureAnswer>
    <DeliveryFormatType />
    </Delivery>
    <Delivery>
    <DeliveryType>CEO</DeliveryType>
    <DeliveryContactName />
    <DeliveryEmailAddress>[email protected]</DeliveryEmailAddress>
    <DeliveryCompanyId>WFADM618</DeliveryCompanyId>
    <DeliveryUserId>PAULSEN</DeliveryUserId>
    <DeliveryFormatType />
    </Delivery>
    <Delivery>
    <DeliveryType>FAX</DeliveryType>
    <DeliveryContactName>Kiran</DeliveryContactName>
    <DeliveryFaxNumber>4807244340</DeliveryFaxNumber>
    <DeliveryFormatType>PDF</DeliveryFormatType>
    </Delivery>
    <Delivery>
    <DeliveryType>DOC</DeliveryType>
    <DeliveryContactName />
    <ReceivingStreet01>2600 South Price Road</ReceivingStreet01>
    <ReceivingStreet02 />
    <ReceivingCity>Chandler</ReceivingCity>
    <ReceivingState>AZ</ReceivingState>
    <ReceivingZip>85248</ReceivingZip>
    <ReceivingCountry>United States</ReceivingCountry>
    </Delivery>
    <Delivery>
    <DeliveryType>DR</DeliveryType>
    <DeliveryContactName />
    <DeliveryEmailAddress>[email protected]</DeliveryEmailAddress>
    <DeliveryCompanyId>WFADM618</DeliveryCompanyId>
    <DeliveryUserId>PAULSEN</DeliveryUserId>
    <DeliveryFormatType />
    </Delivery>
    </PartnerInfo>
    </Biller>
    </Report>

    Try with a XMLTABLE function
    For example to Extract BillerName and BillerID
    with t as(select xmltype( '<?xml version="1.0" encoding="utf-8"?>
    <Report>
    <Biller>
    <BillerName>DONATO TEST BILLER</BillerName>
    <BillerIdNumber>999999999</BillerIdNumber>
    <PartnerInfo>
    <PartnerName>TEST TRADING PARTNER</PartnerName>
    <PartnerVenderNumber>999999999</PartnerVenderNumber>
    <PartnerStreet01 />
    <PartnerStreet02 />
    <PartnerCity />
    <PartnerState />
    <PartnerZip />
    <PartnerCountry />
    <PartnerActive />
    <PartnerContactName />
    <PartnerEmailAddress />
    <PartnerContactPhone />
    <PartnerFaxNumber />
    <PartnerUpdateUser />
    <PartnerUpdateDate />
    <PartnerDocColor />
    <PartnerDocDistribution />
    <PartnerDocPrinting />
    <PartnerDocTiming />
    <Delivery>
    <DeliveryType>EMAIL</DeliveryType>
    <DeliveryContactName>Kiran</DeliveryContactName>
    <DeliveryEmailAddress>[email protected]</DeliveryEmailAddress>
    </Delivery>
    <Delivery>
    <DeliveryType>SECURE</DeliveryType>
    <DeliveryContactName />
    <DeliveryEmailAddress>[email protected]</DeliveryEmailAddress>
    <SecureType />
    <SecureQuestion>Pet Name</SecureQuestion>
    <SecureAnswer>040698de9bf14ef87d8cbaf46b8ecddc</SecureAnswer>
    <DeliveryFormatType />
    </Delivery>
    <Delivery>
    <DeliveryType>CEO</DeliveryType>
    <DeliveryContactName />
    <DeliveryEmailAddress>[email protected]</DeliveryEmailAddress>
    <DeliveryCompanyId>WFADM618</DeliveryCompanyId>
    <DeliveryUserId>PAULSEN</DeliveryUserId>
    <DeliveryFormatType />
    </Delivery>
    <Delivery>
    <DeliveryType>FAX</DeliveryType>
    <DeliveryContactName>Kiran</DeliveryContactName>
    <DeliveryFaxNumber>4807244340</DeliveryFaxNumber>
    <DeliveryFormatType>PDF</DeliveryFormatType>
    </Delivery>
    <Delivery>
    <DeliveryType>DOC</DeliveryType>
    <DeliveryContactName />
    <ReceivingStreet01>2600 South Price Road</ReceivingStreet01>
    <ReceivingStreet02 />
    <ReceivingCity>Chandler</ReceivingCity>
    <ReceivingState>AZ</ReceivingState>
    <ReceivingZip>85248</ReceivingZip>
    <ReceivingCountry>United States</ReceivingCountry>
    </Delivery>
    <Delivery>
    <DeliveryType>DR</DeliveryType>
    <DeliveryContactName />
    <DeliveryEmailAddress>[email protected]</DeliveryEmailAddress>
    <DeliveryCompanyId>WFADM618</DeliveryCompanyId>
    <DeliveryUserId>PAULSEN</DeliveryUserId>
    <DeliveryFormatType />
    </Delivery>
    </PartnerInfo>
    </Biller>
    </Report>')xml from dual)
    select q.* from t,xmltable('/Report' passing t.xml columns
    BillerName varchar2(20) PATH
                          '/Report//Biller/BillerName')q
            BILLERNAME     BILLERID
         DONATO TEST BILLER     999999999

  • Inserting XML content into Database

    Hallo
    i´m new to Oracle.
    i want to insert xml content into the database. for testing i installed the version 10g on a windowsxp computer.
    i read the oracle xmldb developer´s guide. on page 3-4 ff. it is explained how i can insert content into the database. that´s how i did it (with isqlplus):
    create table example1(key_column varchar2(10) primary key, xml_column xmltype)
    -->works fine
    create table example2 of xmltype
    -->works fine
    now i made a directory under c:\myXmlFilesForDb in WinXp
    create directory xmldir as 'c:/myXmlFilesForDb in WinXp'
    (also tried: create directory xmldir as 'c:\myXmlFilesForDb in WinXp')
    --> in this directory is a file named: mydokument.xml
    --> works fine
    insert into example2 values(xmltype(bfilename('xmldir','mydokument.xml'), nls_charset_id('AL32UTF8')))
    the following error message is displayed (in German):
    ORA-22285: Verzeichnis oder Datei für FILEOPEN-Vorgang nicht vorhanden
    ORA-06512: in "SYS.DBMS_LOB",Zeile 523
    ORA-06512: in "SYS:XMLTYPE",Zeile 287
    ORA-06512: in Zeile 1
    whats wrong? can anybody help me please?
    ohhh....
    thank you very much
    cu
    George

    Directory entries are case sensitive.
    Select * From dba_directories to ensure you case is the same as you are using in your insert statement.
    Are you using the same user? if not grant read on directory directoryname to username;
    try to just select.
    select dbms_lob.getLength(BFileName('directoryname','filename.xml'))
    as length
    from dual;

  • Load xml data into database

    Hi,
    I need to load the xml data into the relational tables. I was trying to use a DOM parser, but the thing is that i had to hard code the element node values to match the columns in the tables, and in later stage if there is change to the xml i have to change my program and recompile, i want a more flexible solution, where in i can parse the data and load into database without much changes. I do not know how to accomplish this. I have searched on this topic, but could not find a clear solution anywhere. Can anybody suggest a solution to this.
    Thanks & regards.

    For which database?
    With the Oracle database an XML document may be stored in a database with the XML SQL (XSU) utility.
    1. Create a table in the database with columns corresponding to the elements in the XML document.
    2. With the XSU store the XML document. The attributes in the XML document do not get stored.
    3. To store the attributes also, apply an XSLT to the XML document and convert the attributes to elements.

  • Exception when inserting a XML document into database

    Hello.
    I'm trying to insert the content of a XML document into a database. The problem consists on the exception that is raised when a FK in the XML is not in the database as a PK
    How can i catch these exceptions and continuing inserting the rest of the data
    Thanks in advance ...

    I really hope for you this wasn't a production database, as mentioned in the URL, it has been some years ago for me fiddling around this which was btw a supported metalink workaround ONCE (during my Oracle 7 days), but now, I wouldn't be surprised if you now have mixed NLS content in your tables/database and more or less "corrupted" your content.
    The initial issue was probably a client one.
    BTW
    I actually hope it was a production database, maybe then you would learn that way, that you SHOULD NEVER EVER UPDATE DATABASE BASE TABLES directly...
    ...unless (the only exception) you want to learn something about the internals and don't care that your TEST database gets corrupted....

  • I want to store an xml file into database, and transport it to the XI.

    tell me  in how many ways we can store a xml file in database.
    one i know is.- create a table with field same as that of XML. store XML file data in it
    and at the time of transfering data to XI fatch data from table and create an XML file and transfer...
    tell me if u know some more

    Dear Swethi,
    You can move images to SAP using SE78. then u can use them where ever u you require them.
    SE78->GRAPHICS->BMAP here give ur image name and click on save
    Rgds,
    Kiran
    Edited by: Kiran on Jun 11, 2009 7:15 AM

  • Helped, how to load xml data into database

    Hi,
    Given a DTD, can the XML SQL Utility generate
    the database schema?
    I currently have the dtd file to define
    the data type and xml data and I am looking
    for ways of how the XML/DTD can be loaded
    into the oracle db.
    Any suggestions/recommendations are
    appreciated.
    Thanks,
    Judy
    null

    You could check out this web site:
    http://www.rpbourret.com/xml/XMLAndDatabases.htm#software
    where you can find a list of products that can translate a DTD to a relational schema. Also, there are several technical papers that discuss algorithms to carry out this translation. FYI, We have implemented a similar system,and testing it out.
    null

  • How to insert large xml data into database tables.

    Hi all,
    iam new to xml. i want to insert data in xml file to my database tables.but the xml file size is very large. performance is also one of the issue. can anybody please tell me the procedure to take xml file from the server and insert into my database tables.
    Thanks in advance

    Unfortunately posting very generic questions like this in the forum tends not to be very productive for you, me or the other people who read the forum. It really helps everyone if you take a little time to review existing posts and their answers before starting new threads which replicate subjects that have already been discussed extensively in previous threads. This allows you to ask more sensible questions (eg, I'm using this approach and encountering this problem) rather than extremely generic questions that you can answer yourself by spending a little time reviewing existings posts or using the forum's search feature.
    Also in future your might want to try being a little more specific before posting questions
    Eg Define "very large". I know of customers who thing very large is 100K, and customers who think 4G is medium. I cannot tell from your post what size your files are.
    What is the content of the file. Is it going to be loaded into a single record, or a a single table, or will it need to be loaded into multiple records in a single table or multiple records in multiple tables ?
    Do you really need to load the data into exsiting relational tables or could your application work with relational views of the XML Content.
    Finally which release of the database are you working with.
    Define performance. Is it reasonable to expect to process this kind of document on this machine (Make, memory, #number of CPUs, CPU Speed, number of discs) in this period of time.
    WRT to your original question. If you take a few minutes to search this forum you will find a very large number of threads with very similar titles to yours. These theads document a number of different approaches that can be used to solve this problem.
    I suggest you start by looking for threads that cover topics like DBMS_XMLSTORE, XMLTable(), Relational Views of XML content, loading XML content in relational tables.

  • XML Insert into database by direct http request from browser

    I want to ask if it is possible to pass a xml filename which valuse should be stored in the database directly by a http request of i.e. IE 5.5.
    I mean perhaps such a construction: http://pcziegl/Test_Insert.xsql?posted-xml=http://pcziegl/Test_Insert.xml

    The xsql page looks like:
    <?xml version="1.0"?>
    <xsql:insert-request xmlns:xsql="urn:oracle-xsql" connection="test" table="test"/>
    The xml to be inserted:
    <?xml version="1.0"?>
    <ROWSET>
    <ROW num="1">
    <NAME>andreas</NAME>
    <PASTNAME>fischbach</PASTNAME>
    <VALUE>24</VALUE>
    </ROW>
    <ROW num="2">
    <NAME>robert</NAME>
    <PASTNAME>loerks</PASTNAME>
    <VALUE>40</VALUE>
    </ROW>
    <ROW num="3">
    <NAME>hubert</NAME>
    <PASTNAME>fuenfer</PASTNAME>
    <VALUE>35</VALUE>
    </ROW>
    <ROW num="4">
    <NAME>konrad</NAME>
    <PASTNAME>reiser</PASTNAME>
    <VALUE>38</VALUE>
    </ROW>
    <ROW num="5">
    <NAME>lisa</NAME>
    <PASTNAME>fischer</PASTNAME>
    <VALUE>35</VALUE>
    </ROW>
    <ROW num="6">
    <NAME>wolfgang</NAME>
    <PASTNAME>hesse</PASTNAME>
    <VALUE>53</VALUE>
    </ROW>
    <ROW num="7">
    <NAME>juergen</NAME>
    <PASTNAME>ebbinghaus</PASTNAME>
    <VALUE>33</VALUE>
    </ROW>
    <ROW num="8">
    <NAME>joerg</NAME>
    <PASTNAME>weigl</PASTNAME>
    <VALUE>28</VALUE>
    </ROW>
    <ROW num="9">
    <NAME>tom</NAME>
    <PASTNAME>spaarmann</PASTNAME>
    <VALUE>33</VALUE>
    </ROW>
    </ROWSET>
    Thanks for your advices.

  • Loading an XML file into a database table.

    What is the convenient way to parse XML data present in a data file in server?

    Hi;
    Please check:
    http://riteshkk2000.blogspot.com/2012/01/loadimport-xml-file-into-database-table .html
    http://docs.oracle.com/cd/E18283_01/appdev.112/e16659/xdb03usg.htm#BABIFADB
    http://www.oracle.com/technetwork/articles/quinlan-xml-095823.html
    Regard
    Helios

  • Error while loading XML files into scott user

    Hi All,
    I'm new to xml files. I need to load xml files into database through OWB.
    I have xml file in my local machine & am trying to load into table PO of Scott. Scott is registered as repository user.
    Followed same steps as specified in userguide.
    But, when executing the procedure ( in two ways one as just table name, and other as user.table name) it is showing the below error:
    Procedure is:(1)--with username.tablename
    begin
    wb_xml_load(
    '<OWBXMLRuntime>'||
    '<XMLSource>'||
    '<file>&&SAMPLES_DIR.sample1.xml</file>'||
    '</XMLSource>'||
    '<targets>'||
    '<target dateFormat="yyyy.MM.dd">scott.PO</target>'||
    '</targets>'||
    '</OWBXMLRuntime>'
    end;
    ERROR at line 1:
    ORA-20006: Error occurred while truncating target database object SCOTT.PO.
    Base exception: ORA-01031: insufficient privileges
    ORA-06512: at "OWBSYS.WB_XML_LOAD_F", line 12
    ORA-06512: at "OWBSYS.WB_XML_LOAD", line 4
    ORA-06512: at "SCOTT.SAMPLE1", line 3
    ORA-06512: at line 1
    Procedure is:(2) with out username
    begin
    wb_xml_load(
    '<OWBXMLRuntime>'||
    '<XMLSource>'||
    '<file>&&SAMPLES_DIR.sample1.xml</file>'||
    '</XMLSource>'||
    '<targets>'||
    '<target dateFormat="yyyy.MM.dd">PO</target>'||
    '</targets>'||
    '</OWBXMLRuntime>'
    end;
    ERROR at line 1:
    ORA-20006: Error occurred while truncating target database object PO.
    Base exception: ORA-00942: table or view does not exist
    ORA-06512: at "OWBSYS.WB_XML_LOAD_F", line 12
    ORA-06512: at "OWBSYS.WB_XML_LOAD", line 4
    ORA-06512: at line 2
    xml file:
    <ROWSET>
    <ROW>
    <ID>100</ID>
    <ORDER_DATE>2000.12.20</ORDER_DATE>
    <SHIPTO_NAME>Adrian Howard</SHIPTO_NAME>
    <SHIPTO_STREET>500 Marine World Parkway</SHIPTO_STREET>
    <SHIPTO_CITY>Redwood City</SHIPTO_CITY>
    <SHIPTO_STATE>CA</SHIPTO_STATE>
    <SHIPTO_ZIP>94065</SHIPTO_ZIP>
    </ROW>     
    </ROWSET>
    Note: Everything works fine if I create PO table in OWBSYS user and execute the procedurein OWBSYS user. OWBSYS.PO table will be loaded.
    What privileges are missing, what shouldI do if I want to execute the procedure from scott user and load the table of scott.
    Thanks in advance for the help.
    Regards,
    Joshna

    Hi Joshna,
    Please follow below steps to load xml file to oracle database.
    1.First connect to owb (Design Center) through your repository owner user (ex : REP_OWNER).
    2. Import WB_XML_LOAD procedure . and exit to repository owner.
    3. connect to owb design center through your repository user (ex : REP_USER)
    Create New mapping and drag one Constant Operator and create one attribute, paste / edit following code
    '<OWBXMLRuntime>'||
    '<XMLSource>'||
    '<file>E:\SOURCE\emp.xml</file>'||
    '</XMLSource>'||
    '<targets>'||
    '<target truncateFirst = "FALSE" dateFormat="yyyy.MM.dd">rep_user.emp</target>'||
    '</targets>'||
    '</OWBXMLRuntime>'
    4. Drag pre mapping operator and select WB_XML_LOAD procedure
    5. Connect Constant Operator attribute to pre mapping operator.
    6. Drag two dummy tables and connect source to target. (ex : drag t1 (table) tab two times and connect.
    7. Validate and deploy the mapping.
    8. grant necessary grant command to rep_owner user to rep_user user.
    (Note : target truncateFirst = "FALSE" by default truncate the table. So you have to give grant privileges
    To rep_user , select ,insert, delete privileges.
    9. Execute the mapping , and check EMP table. (Note : before loading EMP table delete all records ).
    10 . If you want more description please go through the below link
    http://download.oracle.com/docs/html/A95931_01/apf.htm
    Regards
    Venkat

  • Best method to load XML data into Oracle

    Hi,
    I have to load XML data into Oracle tables. I tried using different options and have run into a dead end in each of those. I do not have knowledge of java and hence have restricted myself to PL/SQL solutions. I tried the following options.
    1. Using DBMS_XMLSave package : Expects the ROWSET and ROW tags. Connot change format of the incoming XML file (Gives error oracle.xml.sql.OracleXMLSQLException: Start of root element expected).
    2. Using the XMLPARSER and XMLDOM PL/SQL APIs : Works fine for small files. Run into memory problems for large files (Gives error java.lang.OutOfMemoryError). Have tried increasing the JAVA_POOL_SIZE but does not work. I am not sure whether I am changing the correct parameter.
    I have read that the SAX API does not hog memory resources since it does not build the entire DOM tree structure. But the problem is that it does not have a PL/SQL implementation.
    Can anyone PLEASE guide me in the right direction, as to the best way to achieve this through PL/SQL ??? I have not designed the tables so am flexible on using purely relational or object-relational design. Although would prefer to keep a purely relational design. (Had tried used object-relational for 1. and purely relational for 2. above)
    The XML files are in the following format, (EXAMINEEs with single DEMOGRAPHIC and multiple TESTs)
    <?xml version="1.0"?>
    <Root_Element>
    <Examinee>
    <MACode>A</MACode>
    <TestingJID>TN</TestingJID>
    <ExamineeID>100001</ExamineeID>
    <CreateDate>20020221</CreateDate>
    <Demographic>
    <InfoDate>20020221</InfoDate>
    <FirstTime>1</FirstTime>
    <LastName>JANE</LastName>
    <FirstName>DOE</FirstName>
    <MiddleInitial>C</MiddleInitial>
    <LithoNumber>73</LithoNumber>
    <StreetAddress>SomeAddress</StreetAddress>
    <City>SomeCity</City>
    <StateCode>TN</StateCode>
    <ZipCode>37000</ZipCode>
    <PassStatus>1</PassStatus>
    </Demographic>
    <Test>
    <TestDate>20020221</TestDate>
    <TestNbr>1</TestNbr>
    <SrlNbr>13773784</SrlNbr>
    </Test>
    <Test>
    <TestDate>20020221</TestDate>
    <TestNbr>2</TestNbr>
    <SrlNbr>13773784</SrlNbr>
    </Test>
    </Examinee>
    </Root_Element>
    Thanks for the help.

    Please refer to the XSU(XML SQL Utility) or TransX Utility(for Multi-language Document) if you want to load data in XML format into database.
    Both of them require special XML formats, please first refer to the following docs:
    http://otn.oracle.com/docs/tech/xml/xdk_java/doc_library/Production9i/doc/java/xsu/xsu_userguide.html
    http://otn.oracle.com/docs/tech/xml/xdk_java/doc_library/Production9i/doc/java/transx/readme.html
    You can use XSLT to transform your document to the required format.
    If you document is large, you can use SAX method to insert data into database. But you need to write the code.
    The following sample may be useful:
    http://otn.oracle.com/tech/xml/xdk_sample/xdksample_040602i.html

Maybe you are looking for

  • Exporting to pdf changes the resolution

    Good day, I have a document 800px wide in InDesign. When I export it to .pdf and set to 100% zoom it's way more than 800px. The exported .PDF at 100% zoom takes about 1200px instead of 800px and looks awful!! If I export it to .JPG it will export cor

  • Forms 10.1.2.0.2 compatibility with RDBMS 11g: I can't find the matrix

    Hello, I browsed through most sections in metalink support certification tab, but still I can't find the certification matrix for Oracle developer Suite and enterprise database. Any idea where it is located? Thx Pierre

  • Pages error messages:  Existing docs can't be opened

    I'm getting error messages in Pages when I try to save or share an existing document:  "document can't be opened" I closed pages to try again and altho the docs appear in "open recent" (as untitled Doc. 3 and 4), I can't open them...getting same erro

  • War file does not load drivers.

    Hello All, I have made a web application in jsf framework which runs fine in netbeans on 8084 port. but when I copy the war file in my webapps of tomcat which runs on 8080 port. The login page gets loaded but when I click login to validate user in da

  • How can I print in iBooks?

    How can I print in iBooks?