Insert Insert XML file into multiple records in Oracle Database

I would like to find out if it is possible to insert a single XML file into multiple records or tuples in a Oracle database table. I have a single XML file which is at multiple levels. The meta data for the levels are common and each level can have meta data of their own in addition. I do not have any meta data field which will uniquely determine whether the data belongs to Root level, Intermediate level or at the document level. Is there any way I can determine which level the meta data belongs to and thereby make a corresponding entry into the database table tuple? For example I could have an attribute called level which is going to be present only in the database table and not in the XML file. If level=1 then it corresponds to "Root" meta data, if level=2 then it corresponds to "Intermediate" level and if level=3 then it corresponds to meta data at document level. I need a way to calculate the value for level from the XML file and thereby insert the meta data element into a tuple in a single table in Oracle.

Hi,
extract your xml and then you can use insert all clause.
here's very small example on 10.2.0.1.0
SQL> create table table1(id number,val varchar2(10));
Table created.
SQL> create table table2(id number,val varchar2(10));
Table created.
SQL> insert all
  2  into table1 values(id,val)
  3  into table2 values(id2,val2)
  4  select extractValue(x.col,'/a/id1') id
  5        ,extractValue(x.col,'/a/value') val
  6        ,extractValue(x.col,'/a/value2') val2
  7        ,extractValue(x.col,'/a/id2') id2
  8  from (select xmltype('<a><id1>1</id1><value>a</value><id2>2</id2><value2>b</value2></a>') col from dual) x;
2 rows created.
SQL> select * from table1;
        ID VAL                                                                 
         1 a                                                                   
SQL> select * from table2;
        ID VAL                                                                 
         2 b                                                                    Ants

Similar Messages

  • Need to Load data in XML file into multiple Oracle tables

    Experts
    I want to load data that is stored at XML file into multiple Oracle table using plsql.
    I am novice in this area.Kindly explain in depth or step by step so that i can achive this.
    Thanks in advnace.

    Hi,
    extract your xml and then you can use insert all clause.
    here's very small example on 10.2.0.1.0
    SQL> create table table1(id number,val varchar2(10));
    Table created.
    SQL> create table table2(id number,val varchar2(10));
    Table created.
    SQL> insert all
      2  into table1 values(id,val)
      3  into table2 values(id2,val2)
      4  select extractValue(x.col,'/a/id1') id
      5        ,extractValue(x.col,'/a/value') val
      6        ,extractValue(x.col,'/a/value2') val2
      7        ,extractValue(x.col,'/a/id2') id2
      8  from (select xmltype('<a><id1>1</id1><value>a</value><id2>2</id2><value2>b</value2></a>') col from dual) x;
    2 rows created.
    SQL> select * from table1;
            ID VAL                                                                 
             1 a                                                                   
    SQL> select * from table2;
            ID VAL                                                                 
             2 b                                                                    Ants

  • C# Split xml file into multiple files

    Below i have an xml file, in this file, i need to split this xml file into multiple xml files based on date column value,
    suppose i have 10 records with 3 different dates then all unique date records should go into each file . for ex here i have a file with three dates my output should get 3 files while each file containing all records of unique date data. I didn't get any idea
    to proceed on this, thats the reason am not posting any code.Needed urgently please
    <XML>
    <rootNode>
    <childnode>
    <date>2012-12-01</date>
    <name>SSS</name>
    </childnode>
    <childnode>
    <date>2012-12-01</date>
    <name>SSS</name>
    </childnode>
    <childnode>
    <date>2012-12-02</date>
    <name>SSS</name>
    </childnode>
    <childnode>
    <date>2012-12-03</date>
    <name>SSS</name>
    </childnode>
    </rootNode>
    </XML>

    Here is full code:
    using System.Xml.Linq;
    class curEntity
    public DateTime Date;
    public string Name;
    public curEntity(DateTime _Date, string _Name)
    Date = _Date;
    Name = _Name;
    static void Main(string[] args)
    XElement xmlTree = new XElement("XML",
    new XElement("rootNode",
    new XElement("childnode",
    new XElement("date"),
    new XElement("name")
    string InfilePath = @"C:\temp\1.xml";
    string OutFilePath = @"C:\temp\1_";
    XDocument xmlDoc = XDocument.Load(InfilePath);
    List<curEntity> lst = xmlDoc.Element("XML").Element("rootNode").Elements("childnode")
    .Select(element => new curEntity(Convert.ToDateTime(element.Element("date").Value), element.Element("name").Value))
    .ToList();
    var unique = lst.GroupBy(i => i.Date).Select(i => i.Key);
    foreach (DateTime dt in unique)
    List<curEntity> CurEntities = lst.FindAll(x => x.Date == dt);
    XElement outXML = new XElement("XML",
    new XElement("rootNode")
    foreach(curEntity ce in CurEntities)
    outXML.Element("rootNode").Add(new XElement("childnode",
    new XElement("date", ce.Date.ToString("yyyy-MM-dd")),
    new XElement("name", ce.Name)
    outXML.Save(OutFilePath + dt.ToString("yyyy-MM-dd") + ".xml");
    Console.WriteLine("Done");
    Console.ReadKey();

  • Collect data from a dynamic XML file into multiple internal tables

    I need to convert the XML file into multiple internal tables. I tried many links and posts in SDN but still was facing difficulty in achieving this. Can some one tell me where I am going wrong.
    My XML file is of the following type.It is very complex and the dynamice.
    The following tags occur more than once in the XML file. The "I" and "L" tags and its child tags can occur ones or more than once for each XML file and it is not constant. i.e in one file they can occur 1 time and in another they can occur 100 times.
    "I" and "L" are child tags of <C>
    <I>
           <J>10</J>
             <K>EN</K>
      </I>
    <L>
             <J>20</J>
              <N>BB</N>
      </L>
    Tags <C> and <F> occur only ones for each XML file. <C> is the child tag of "A" and "F" is the child tag of <C>.
    I need to collect <D>, <E> in one internal table ITAB.
    I need to collect <G>, <H> in one internal table JTAB.
    I need to collect <J>, <K> in one internal table KTAB.
    I need to collect <J>, <N> in one internal table PTAB.
    Below is the complete XML file.
    ?xml version="1.0" encoding="iso-8859-1" ?>
    <A>
        <B/>
        <C>
           <D>RED</D>
           <E>999</E>
        <F>
           <G>TRACK</G>
           <H>PACK</H>
        </F>
        <I>
           <J>10</J>
           <K>EN</K>
        </I>
        <I>
           <J>20</J>
           <K>TN</K>
        </I>
        <I>
           <J>30</J>
           <K>KN</K>
        </I>
        <L>
           <J>10</J>
           <N>AA</N>
        </L>
        <L>
           <J>20</J>
           <N>BB</N>
        </L>
        <L>
           <J>30</J>
           <N>CC</N>
        </L>
        </C>
      </A>
    With the help of SDN I am able to gather the values of <D> <E> in one internal table.
    Now if I need to gather
    <G>, <H> in one internal table JTAB.
    <J>, <K> in one internal table KTAB.
    <J>, <N> in one internal table PTAB.
    I am unable to do. I am following  XSLT transformation method. If some one has some suggestions. Please help.
    Here is my ABAP program
    TYPE-POOLS abap.
    CONSTANTS gs_file TYPE string VALUE 'C:\TEMP\ABCD.xml'.
    * This is the structure for the data from the XML file
    TYPES: BEGIN OF ITAB,
             D(10) TYPE C,
             E(10) TYPE C,
           END OF ITAB.
    * Table for the XML content
    DATA: gt_itab       TYPE STANDARD TABLE OF char2048.
    * Table and work ares for the data from the XML file
    DATA: gt_ITAB     TYPE STANDARD TABLE OF ts_ITAB,
          gs_ITAB     TYPE ts_ITAB.
    * Result table that contains references
    * of the internal tables to be filled
    DATA: gt_result_xml TYPE abap_trans_resbind_tab,
          gs_result_xml TYPE abap_trans_resbind.
    * For error handling
    DATA: gs_rif_ex     TYPE REF TO cx_root,
          gs_var_text   TYPE string.
    * Get the XML file from your client
    CALL METHOD cl_gui_frontend_services=>gui_upload
      EXPORTING
        filename                = gs_file
      CHANGING
        data_tab                = gt_itab1
      EXCEPTIONS
        file_open_error         = 1
        file_read_error         = 2
        no_batch                = 3
        gui_refuse_filetransfer = 4
        invalid_type            = 5
        no_authority            = 6
        unknown_error           = 7
        bad_data_format         = 8
        header_not_allowed      = 9
        separator_not_allowed   = 10
        header_too_long         = 11
        unknown_dp_error        = 12
        access_denied           = 13
        dp_out_of_memory        = 14
        disk_full               = 15
        dp_timeout              = 16
        not_supported_by_gui    = 17
        error_no_gui            = 18
        OTHERS                  = 19.
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    * Fill the result table with a reference to the data table.
    * Within the XSLT stylesheet, the data table can be accessed with
    * "IITAB".
    GET REFERENCE OF gt_shipment INTO gs_result_xml-value.
    gs_result_xml-name = 'IITAB'.
    APPEND gs_result_xml TO gt_result_xml.
    * Perform the XSLT stylesheet
    TRY.
        CALL TRANSFORMATION zxslt
        SOURCE XML gt_itab1
        RESULT (gt_result_xml).
      CATCH cx_root INTO gs_rif_ex.
        gs_var_text = gs_rif_ex->get_text( ).
        MESSAGE gs_var_text TYPE 'E'.
    ENDTRY.
    * Now let's see what we got from the file
    LOOP AT gt_ITAB INTO gs_ITAB.
      WRITE: / 'D:', gs_ITAB-D.
      WRITE: / 'E :', gs_ITAB-E.
    ENDLOOP.
    Transformation
    <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
      <xsl:output encoding="iso-8859-1" indent="yes" method="xml" version="1.0"/>
      <xsl:strip-space elements="*"/>
      <xsl:template match="/">
        <asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
          <asx:values>
            <IITAB>
              <xsl:apply-templates select="//C"/>
            </IITAB>
          </asx:values>
        </asx:abap>
      </xsl:template>
      <item>
          <D>
            <xsl:value-of select="D"/>
          </D>
          <E>
            <xsl:value-of select="E"/>
          </E>
        </item>
      </xsl:template>
    </xsl:transform>
    Now the above pgm and transformation work well and I am able to extract data into the ITAB. Now what changes should I make in transformation and in pgm to collect
    <G>, <H> in one internal table JTAB.
    <J>, <K> in one internal table KTAB.
    <J>, <N> in one internal table PTAB.
    Please help..i am really tring hard to figure this out. I am found lot of threads addressing this issue but not my problem.
    Kindly help.
    Regards,
    VS

    Hi Rammohan,
    Thanks for the effort!
    But I don't need to use GUI upload because my functionality does not require to fetch data from presentation server.
    Moreover, the split command advised by you contains separate fields...f1, f2, f3... and I cannot use it because I have 164 fields.  I will have to split into 164 fields and assign the values back to 164 fields in the work area/header line.
    Moreover I have about 10 such work areas.  so the effort would be ten times the above effort! I want to avoid this! Please help!
    I would be very grateful if you could provide an alternative solution.
    Thanks once again,
    Best Regards,
    Vinod.V

  • Loading XML files into an 8.0.6 database...

    Hi,
    I've got an Oracle 8.0.6 instance (Sun E250 Solaris 5.7) with multiple import data feeds. I am currently using SQL*Loader to load this data which are flat text delimited files. My data feeds will soon be supplying XML files instead of these flat files which is great, unfortunately, I will not be able to upgrade in 8.1.7 in time so that I can use the XML parser.
    Is there anyway I can use SQL*Loader or some other tool to load XML files into my 8.0.6 database? If there is a way, could someone please send the information I would need to help perform this task?
    Thanks for all your help...
    Gerry D'Costa
    Database Administrator
    [email protected]
    12Snap.com

    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

  • Insert large XML files into 11g

    Can anyone post an example of inserting XML files into a XMLType table? I can use the following to insert files into a CLOB table without problems.
    $lob = oci_new_descriptor($conn, OCI_D_LOB);
              $sql = "insert into D (DATASET_ID, XML_DATA)
    values(
                   dataset_id_seq.NEXTVAL,
                   EMPTY_CLOB( )
              ) RETURNING XML_DATA into :the_blob";
              $stmt = oci_parse($conn, $sql);
              oci_bind_by_name($stmt, ':the_blob', $lob, -1, OCI_B_CLOB);
              oci_execute($stmt, OCI_DEFAULT);
              if ($lob->savefile($f)){
                   oci_commit($conn);
                   echo "Blob successfully uploaded\n";
              }else{
                   echo "Couldn't upload Blob\n";
              oci_free_descriptor($lob);
              oci_free_statement($stmt);

    A small example to insert xml file into oracle xml DB
    //$Xml contains the xml file you want to insert into the database.
    $insertXML = <<<EOF
    DECLARE xml CLOB := $Xml; begin INSERT INTO purchaseorder_as_column VALUES (1,XMLType(xml)); end;
    EOF;
    $stid = oci_parse($c, $insertXML);
    oci_execute($stid);
    //retrieve the xml data from the that table
    $sql = "select XMLTYPE.GetClobVal(xml_document) from purchaseorder_as_column where id=1";
    $stid = oci_parse($c, $sql);
    oci_execute($stid);
    $res = oci_fetch_row($stid);
    $xmldoc = $res[0]->load();
    //Then use simple xml extensions or others as you like to deal with the XML document
    $sxe = simplexml_load_string($xmldoc);
    //other operations with tthe xml data
    var_dump($sxe);

  • How to populate a form from an xml file with multiple records

    I want to be able to create a single form that will add pages as needed based upon the number of records being imported from an xml file.
    I have an IRS form that does this exactly, but I do not know how to re-create it.  I entered data into the form, then exported that data to xml.  Then I opened that xml file in excel and added more records (this is just an easy way to manage the xml data in a tabular form).  Then I import the changed xml file into the IRS form and it adds as many pages as I have records.  Perfect!  Unfortunately, I cannot edit the form to examine the technique.  It does not appear to be relying upon any additional local javascript files.  It does use an 'add page' button which may suggest the form is using the template .spawn() technique, but when I try that in my own form, it gives me unique field names for each page which are then not consistent with the xml data.  Hopefully someone can help me understand what I am missing.

    did you want
    <record>0
    <data>"11.97.23.174/32"
    <record>address <data>
    <record>address <data>
    <record>subnet <data>
    <record>ip <data>"10.97.23.174"</data></record>
    </data></record>
    </data></record>
    </data></record>
    </data></record>
    or
    <record>0
    <data>"11.97.23.174/32"
    <record>address <data>
    <record>address <data>
    <record>subnet <data>
    <record>ip <data>"10.97.23.174"</data></record>

  • Xml Data into Table Within an Oracle Database

    With no oracle or database background, I have been tasked to figure out how to analyze reading values within xml files. I initially started by writing c# code to read through the xml files, pull out the values I need and summarize the results. Unfortunately, this took atleast 5 hours to open all the xml files and summarize the results for a small portion of EndPointChannelId's and xml files. I decided to store all the reading values within the xml files into a table so I can use SQL queries to do the analysis instead of having to process through all the files each time. Using the same c# code as before, I have used insert and update sql statements to insert the reading values into a table. To my dismay, it takes about 3 and a half hours to import 1 file where there is 20 files a day :S. There are over 19,000 ChannelID's per file. I am currently using SQL Developer to view the data and have noticed XML Schemas and XML DB Repository but am not sure if that would be the best approach to my problem. I need to increase the efficiency of the import process but I am having difficulties trying to figure out how to go about it. Do you have any suggestions on where I should go from here? What is the most efficient way you have used to import xml files into a table structure. I would greatly appreciate any ideas!
    Below is a portion of the xml file that I am working with.
    - <Channel ReadingsInPulse="false" IsRegister="false" IsReadingDecoded="true" MarketType="Electric" IntervalLength="60">
    <ChannelID EndPointChannelID="57432:1" />
    - <ContiguousIntervalSets>
    - <ContiguousIntervalSet NumberOfReadings="6">
    <TimePeriod EndRead="22467.80" EndTime="2013-05-09T13:00:00Z" StartTime="2013-05-09T07:00:00Z" />
    - <Readings>
    <Reading Value="0.31" />
    <Reading Value="0.4" />
    <Reading Value="0.16" />
    <Reading Value="0.32" />
    <Reading Value="0.09" />
    <Reading Value="0.35" />
    </Readings>
    </ContiguousIntervalSet>
    </ContiguousIntervalSets>
    </Channel>

    Hi,
    Welcome to the forums,
    what i understand from your Post, You want to read/analyze some value from xml files. and for this you want to import it in database and then perform some Query on that file for easy work.
    you can choose the External table concept for reading/ Query those files
    check this link may it help you
    Creation of External table by using XML files.
    http://docs.oracle.com/cd/B28359_01/server.111/b28310/tables013.htm

  • Loading XML files into multiple tables

    I've got XML like so...
    <?xml version="1.0" encoding="UTF-8"?>
    <MainTitle Version="1.0" Date="2009-01-11">
    <MainName>
    <ID1>A</ID1>
    <ID2>ABC</ID2>
    <ID3>ABC123</ID3>
    <Desc>Some text</Desc>
    <feature>f1</feature>
    <feature>f2</feature>
    <Category>
    <name>n1</name>
    <attribute>more stuff</attribute>
    </Category>
    <Category>
    <name>n2</name>
    <attribute>even more stuff</attribute>
    </Category>
    <Category>
    <name>n3</name>
    <attribute>different stuff</attribute>
    </Category>
    <Category>
    <name>n4</name>
    <attribute>More of the same<attribute>
    <attribute>But different still</attribute>
    <attribute>Even more different junk<attribute>
    </Category>
    </MainName>
    </MainTitle>
    Where each MainName instance in the file can have 0 or more ( unbounded ) Category and Feature tags and each Category instance can have multiple attribute tags. The file contains many thousands of MainName instances and has embedded a good mix of possible tags.
    I believe I can load this into 9i xmltype table or a 9i table with an xmltype column, then query the data to get it out...
    SQL> create table mytab (
    2 xmlraw XMLType
    3 );
    Table created.
    SQL>
    SQL> insert into mytab values ( sys.xmltype.createxml(
    2 '<?xml version="1.0" encoding="UTF-8"?>
    3 <MainTitle Version="1.0" Date="2009-01-11">
    4 <MainName>
    5 <ID1>A</ID1>
    6 <ID2>ABC</ID2>
    7 <ID3>ABC123</ID3>
    8 <Desc>Some text</Desc>
    9 <feature>f1</feature>
    10 <feature>f2</feature>
    11 <Category>
    12 <name>n1</name>
    13 <attribute>more stuff</attribute>
    14 </Category>
    15 <Category>
    16 <name>n2</name>
    17 <attribute>even more stuff</attribute>
    18 </Category>
    19 <Category>
    20 <name>n3</name>
    21 <attribute>different stuff</attribute>
    22 </Category>
    23 <Category>
    24 <name>n4</name>
    25 <attribute>More of the same</attribute>
    26 <attribute>But different still</attribute>
    27 <attribute>Even more different junk</attribute>
    28 </Category>
    29 </MainName>
    30 </MainTitle>')
    31 );
    1 row created.
    1 select
    2 extract(a.xmlraw,'/MainTitle/MainName/ID1/text()'),
    3 extract(a.xmlraw,'/MainTitle/MainName/ID2/text()'),
    4 extract(a.xmlraw,'/MainTitle/MainName/ID3/text()'),
    5 extract(a.xmlraw,'/MainTitle/MainName/Desc/text()'),
    6 extract(a.xmlraw,'/MainTitle/MainName/feature/text()'),
    7 extract(a.xmlraw,'/MainTitle/MainName/Category/text()'),
    8 extract(a.xmlraw,'/MainTitle/MainName/Category/name/text()'),
    9 extract(a.xmlraw,'/MainTitle/MainName/Category/attribute/text()')
    10* from mytab a
    SQL> /
    A
    ABC
    ABC123
    Some text
    f1f2
    n1n2n3n4
    more stuffeven more stuffdifferent stuffMore of the sameBut different stillEven
    more different junk
    This all works just fine, however, it's not quite what I need. For starters, the multiple tag data is concatenated and when I try to specifically query it out using a where clause I get ORA 22950. So, not sure how to deal with that.
    Is it possible to use sqlldr to get the 200MB XML file loaded into a table like that above?
    Now, given multiple "feature" and "category" data per "MainName", I need to use the SQL to dump the XML data into a set of tables built to model the structure of the XML...
    roughly..
    Main_Table (
    ID1 Varchar2(10)
    ID2 varchar2(10)
    ID3 varchar2(10)
    desc varchar2(100)
    Features_Table (
    ID1 varchar2(10)
    feature varchar2(100)
    Category_Table (
    ID1 varchar2(10)
    name varchar2(100)
    attribute varchar2(100)
    What are the groups recommendations here? Should I continue down this route or is there a better way?

    When I suggested the option to parse the XML in PL/SQL I was referring to pulling the data into PL/SQL and then performing all parsing activity against the PL/SQL copy and you don't need to make SQL calls.
    Here is a quick sample for parsing out all the Category/name elements from the XML once it is loaded into PL/SQL
    DECLARE
      l_index     PLS_INTEGER;
      l_category  XMLTYPE;
      l_db_row    XMLTYPE := XMLTYPE('<?xml version="1.0" encoding="UTF-8"?>
    <MainTitle Version="1.0" Date="2009-01-11">
       <MainName>
          <ID1>A</ID1>
          <ID2>ABC</ID2>
          <ID3>ABC123</ID3>
          <Desc>Some text</Desc>
          <feature>f1</feature>
          <feature>f2</feature>
          <Category>
             <name>n1</name>
             <attribute>more stuff</attribute>
          </Category>
          <Category>
             <name>n2</name>
             <attribute>even more stuff</attribute>
          </Category>
          <Category>
             <name>n3</name>
             <attribute>different stuff</attribute>
          </Category>
          <Category>
             <name>n4</name>
             <attribute>More of the same</attribute>
             <attribute>But different still</attribute>
                   <attribute>Even more different junk</attribute>
              </Category>
         </MainName>
    </MainTitle>');
    BEGIN
       l_index := 1;
       WHILE l_db_row.Existsnode('/MainTitle/MainName/Category[' ||
                                 To_Char(l_index) || ']') > 0
       LOOP
          l_category := l_db_row.Extract('/MainTitle/MainName/Category[' ||
                                           To_Char(l_index) || ']');
          dbms_output.put_line(l_category.extract('Category/name/text()').getStringVal());
          l_index := l_index + 1;
       END LOOP;
    END;You could repeat the WHILE loop to parse out the attribute column as well since it repeats. This is what Dave's post was showing and what I was referring to.
    Hint: If you are trying to use .extract to go after an optional node, you need to verify the node exists via existsNode first. If you don't you can get an "ORA-30625: method dispatch on NULL SELF argument is disallowed" error when trying to extract a non-existent node.

  • Need to store multiple xml files as each record in oracle table

    Hi All,
    I have a set of XML files (say 20 xml files). I need to store the enitire content of each file as a string into the oracle table.
    Do we have any PL/SQL procedures which will do this job. I will pass the path of the directory to the procedure, so that it takes all the xml files and store it in the table.
    After that i need to remove some tags of the xml. so it will be better if we store records as a string rather than of xmltype.
    Please help in achieving this.
    Thanks in Advance,
    Ram Mohan T

    Hi Gyanchand,
    I have wrote an article BizTalk Server 2010: Grouping
    and Debatching/Splitting Inbound Messages (TypedPolled) from WCF-SQL Adapter  which is for SQL, but yes same can be done with Oracle.
    If grouping is not required then, you can overlook it and apply debatching only.
    Maheshkumar
    S Tiwari|User
    Page|Blog|BizTalk
    Server: Multiple XML files to Single FlatFile Using File Adapter

  • Importing CSV files into Multiple Tables in One Database

     I have a web based solution using Microsoft SharePoint and SQL Server that is created to centralize dat collection and reporting of program metrics used in montly reviews.
    A person from each program enters dat manual or by pushing the data using automated data import tools. The user then is able to generate reports and provide presentations to their stakeholders.
    There are are programs that are located in US and 2 that are located in Japan. All, including programs in Japan use the MS Project with a plug-in tool that allows them to auto input data. When the user click the "Send To.." button, the data goes
    in to multiple tables in one database.
    Everything is set up exactly the same for every program; however, we have discovered becase of a firewall, along with some of the different settings that the MS Project has over in Japan, the 2 program users are not able to auto import their data.
    The suggestion is to have the program users export the MS Project file into a CSV and email it. I will then take it and convert the data, such as the dates and place them on a Network Drive. There will be 2 folders, one for each program.
    I feel it will be an easy process just to load the data from the Network Drive into the same tables that are created for auto import.
    My Concerns/Questions:
    1. Should I create 1 SSIS package or should there be 2, one for each program?
    2. US and Japan program users send their data once a month. The converted files are going to be saved in the location marked with a date (ex:201402). How can i have it to where SSIS will automatically load the data every time i place new files in the designated
    folders or when i update an exsisting file?
    Can you provide an example with your suggestion please?
    I greatly appreciate the assistance!
    Y_Tyler

    Hello Vikash,
    Thank you! This will help me get started.
    There will be 2 folders, one with files with Program A data and the other with files with Program B data. All will have the same fields, just coming from different programs. You stated that I will be able to to load both in one package. Would there be two
    paths since there will be two separate folders?
    Using the example you provided, i am confident that I can create the package using one path into one table but not sure how to get the files from 2 paths (if there is) into multiple tables.
    Can you help clarify this for me?
    Thank you!
    Y_Tyler

  • Examples of hwo to insert an XML file into a field which is of type CLOB

    I am trying to use the following command, but it does not work, due to a type issue, anyone have another example?
    INSERT INTO TEST VALUES (xmltype(bfilename('c:\', 'c:\test.xml') , nls_charset_id('AL32UTF8')));

    I get the following error, probably means the file referenced is not available...
    SQL Error: ORA-22806: not an object or REF
    22806. 00000 - "not an object or REF"
    *Cause:    An attempt was made to extract an attribute from an item that is
    neither an object nor a REF.
    *Action:   Use an object type or REF type item and retry the operation.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • XML file with multiple records

    I have an XML data file that will look something like this (repeated possibly several hundred times):
    <?xml version='1.0' encoding='utf-8'?>
    <A><V>Wake up to WonderWidgets!</V>
    <C>Why are great</C>
    </A>
    <?xml version='1.0' encoding='utf-8'?>
    <A>Eric</A>
    When I try to parse the code using the Echo03.java sample from the website, I get the following error: END_ELM: </>org.xml.sax.SAXParseException: XML declaration may only begin entities.
         at org.apache.crimson.parser.Parser2.fatal(Parser2.java:3339)
         at org.apache.crimson.parser.Parser2.fatal(Parser2.java:3327)
         at org.apache.crimson.parser.Parser2.maybePI(Parser2.java:1107)
         at org.apache.crimson.parser.Parser2.maybeMisc(Parser2.java:1233)
         at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:638)
         at org.apache.crimson.parser.Parser2.parse(Parser2.java:333)
         at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:448)
         at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
         at javax.xml.parsers.SAXParser.parse(SAXParser.java:281)
         at Echo03.main(Echo03.java:60)
    Is there any way (short of actually reading the file and looking for the beginning of each record) that I can get the parser to do multiple stard and end documents or at least get it to read and parse all the entries in the file?
    Thanks

    Yout file should look something like this: <
    ?xml version='1.0' encoding='utf-8'?>
    <start>
    <A><V>Wake up to WonderWidgets!</V>
    <C>Why are great</C>
    </A>
    <A>Eric</A>
    </start>
    you can only have one root element ( e.g. <start> )

  • Error while inserting .doc file into CLOB object in oracle

    hello everybody ,
    i am trying to insert .doc file into clob column in oracle database.i am using oracle 8i. But i am getting error saying
    ORA-01461: can bind a LONG value only for insert into a LONG column
    i have no clue.
    i am pasting code here
    please help me out.
    regards
    darshan
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileReader;
    import java.io.Reader;
    import java.sql.Connection;
    import java.sql.PreparedStatement;
    public class InsertingClob {
    public static void main(String[] args) {
    File f = new File("E:\\dar
    sowres.doc");
    int len = (int) f.length();
    System.out.println(len);
    Connection conn = null;
    PreparedStatement ps = null;
    try {
    FileReader fr = new FileReader(f);
    String FILE_INSERT_QUERY = "INSERT INTO RESUMED VALUES(?,?)";
    conn = JDBCUtility.getConnection();
    ps = conn.prepareStatement(FILE_INSERT_QUERY);
    ps.setString(1,"1");
    ps.setCharacterStream(2,fr,len);
    int result = ps.executeUpdate();
    if(result ==1) {
    System.out.println("file has been successfully inserted into the db");;
    }else {
    System.out.println("not inserted");
    }catch (Exception e) {
    e.printStackTrace();
    and the error is
    java.sql.SQLException: ORA-01461: can bind a LONG value only for insert into a LONG column
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
    at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
    at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:582)
    at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1986)
    at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1144)
    at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2152)
    at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:2035)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2876)
    at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:609)
    at InsertBlob.main(InsertBlob.java:21)
    java.sql.SQLException: ORA-01461: can bind a LONG value only for insert into a LONG column

    You may have one of a few errors going for you there:
    The error says your column in Oracle is a Long not a CLOB, if it is, then make your column a CLOB.
    CLOB's are not suppored in all environments and/or all interfaces (specifically Windoz ODBC has a problem).
    I believe a DOC (Windoz MS-Word) file is a BLOB, due to formatting characters in the file.
    I had a very similar error using Access and trying to do this, but changing to SAS fixed the problem. It could very well be that your version of ODBC/JDBC drivers does not support it properly.

  • XML document into multiple tables

    How to insert a xml document into multiple tables. Eg. Purchase Order having multiple line items. I have to insert xml document into Parent as well as child with different sets of columns.

    I created the tables using the create_ch14_tables.sql. I call it using java -classpath .;C:\commerceone\xpc\lib\xmlparserv2.jar;C:\commerceone\xpc\lib\classes12.zip;C:\commerceone\xpc\lib\xsu12.jar XMLLoader -file deptempdepend.xml -connName default -transform deptempdepend.xsl. The code doesn't seem to like the "<xsl:for-each select="Department">" tags. If I remove them, the insDoc.getDocumentElement().getFirstChild() will find the element, but it still doesn't insert anything into the database.
    Thank You,
    Dave

Maybe you are looking for

  • My MacBook Pro SAD experience: MUST READ if you are about to get 1.

    Things to clarify at the beginning: 1. im not an english native speaker so try not be too picky for my language. 2. im not a mac hater and i've own a powerbook 17 1.5g as well as a iMac G5 Here we go: 1. I've spent £2000+ to get my top spec MacBook P

  • HELP ACR 4.6 fails to load/work in photshop CS3 running on vista home premium

    Can anyone help me. i had photoshop CS3 on windows xp and it loaded up canon 450d raw files happily/and bridge worked fine- showing raw thumbnails. now i loaded onto new laptop running vista home premium and it works that is cs3 but auto installer ca

  • How To Do Frame animation w/ Multiple Layers Per Frame

    So I'm working on an 8-bit character template as game art. I've got multiple layers (ie: Hat Apparel, Body, Pants, Shirt, Neck Apparel, Mouth Apparel). I want all of these to be animated in their own layers. Is there a way to do that? I have all of t

  • Mail checking for messages FOREVER .... (New iPad)

    After upgrading to IOS 6, my mailbox is not receiving any messages.  All I get is the msg saying "checking for mail" and the spinning wheel goes on forever. After it stopped spinning, no emails came in (via my hotmail account) although I can see some

  • Help! Calling Problem

    I just bought a white Iphone 4. When calling, the receiver can not hear me time to time? What is the problem? How can I do?