XML data upload only from .xml file

Hi,
Can anyone let me know is ther any way how I can upload the data from .xml file into Oracle Table.
Note: I just want to upload the data from xml file; not entire .xml file.
I have data like as below in test.xml file and I want to upload the data only into TEST_EMP table:
<?xml version = '1.0'?>
<ROWSET>
<ROW num="1">
<TABLE_NAME>DEPT</TABLE_NAME>
<TABLESPACE_NAME>USERS</TABLESPACE_NAME>
</ROW>
<ROW num="2">
<TABLE_NAME>EMP</TABLE_NAME>
<TABLESPACE_NAME>USERS</TABLESPACE_NAME>
</ROW>
<ROW num="3">
<TABLE_NAME>BONUS</TABLE_NAME>
<TABLESPACE_NAME>USERS</TABLESPACE_NAME>
</ROW>
<ROW num="4">
<TABLE_NAME>SALGRADE</TABLE_NAME>
<TABLESPACE_NAME>USERS</TABLESPACE_NAME>
</ROW>
<ROW num="5">
<TABLE_NAME>BHAVESH_EMP</TABLE_NAME>
<TABLESPACE_NAME>USERS</TABLESPACE_NAME>
</ROW>
</ROWSET>
Any help would be highly appreciated!!
Thanks... Bhavesh

You may convert the XML into a simple select and insert manually:
SQL> INSERT INTO test_emp
   SELECT EXTRACTVALUE (t2.COLUMN_VALUE, '/ROW/TABLE_NAME') table_name,
          EXTRACTVALUE (t2.COLUMN_VALUE, '/ROW/TABLESPACE_NAME')
                                                              tablespace_name
     FROM TABLE
             (XMLSEQUENCE
                 (EXTRACT
                     (XMLTYPE
                         ('<?xml version = ''1.0''?>
<ROWSET>
<ROW num="1">
<TABLE_NAME>DEPT</TABLE_NAME>
<TABLESPACE_NAME>USERS</TABLESPACE_NAME>
</ROW>
<ROW num="2">
<TABLE_NAME>EMP</TABLE_NAME>
<TABLESPACE_NAME>USERS</TABLESPACE_NAME>
</ROW>
<ROW num="3">
<TABLE_NAME>BONUS</TABLE_NAME>
<TABLESPACE_NAME>USERS</TABLESPACE_NAME>
</ROW>
<ROW num="4">
<TABLE_NAME>SALGRADE</TABLE_NAME>
<TABLESPACE_NAME>USERS</TABLESPACE_NAME>
</ROW>
<ROW num="5">
<TABLE_NAME>BHAVESH_EMP</TABLE_NAME>
<TABLESPACE_NAME>USERS</TABLESPACE_NAME>
</ROW>
</ROWSET>
                      '/ROWSET'
             ) t,
          TABLE (XMLSEQUENCE (EXTRACT (t.COLUMN_VALUE, '/ROWSET/ROW'))) t2

Similar Messages

  • How to load date and time from text file to oracle table through sqlloader

    hi friends
    i need you to show me what i miss to load date and time from text file to oracle table through sqlloader
    this is my data in this path (c:\external\my_data.txt)
    7369,SMITH,17-NOV-81,09:14:04,CLERK,20
    7499,ALLEN,01-MAY-81,17:06:08,SALESMAN,30
    7521,WARD,09-JUN-81,17:06:30,SALESMAN,30
    7566,JONES,02-APR-81,09:24:10,MANAGER,20
    7654,MARTIN,28-SEP-81,17:24:10,SALESMAN,30my table in database emp2
    create table emp2 (empno number,
                      ename varchar2(20),
                      hiredate date,
                      etime date,
                      ejob varchar2(20),
                      deptno number);the control file code in this path (c:\external\ctrl.ctl)
    load data
    infile 'C:\external\my_data.txt'
    into table emp2
    fields terminated by ','
    (empno, ename, hiredate, etime, ejob, deptno)this is the error :
    C:\>sqlldr scott/tiger control=C:\external\ctrl.ctl
    SQL*Loader: Release 10.2.0.1.0 - Production on Mon May 31 09:45:10 2010
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    Commit point reached - logical record count 5
    C:\>any help i greatly appreciated
    thanks
    Edited by: user10947262 on May 31, 2010 9:47 AM

    load data
    infile 'C:\external\my_data.txt'
    into table emp2
    fields terminated by ','
    (empno, ename, hiredate, etime, ejob, deptno)Try
    load data
    infile 'C:\external\my_data.txt'
    into table emp2
    fields terminated by ','
    (empno, ename, hiredate, etime "to_date(:etime,'hh24:mi:ss')", ejob, deptno)
    this is the error :
    C:\>sqlldr scott/tiger control=C:\external\ctrl.ctl
    SQL*Loader: Release 10.2.0.1.0 - Production on Mon May 31 09:45:10 2010
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    Commit point reached - logical record count 5
    C:\>
    That's not an error, you can see errors within log and bad files.

  • Upload hierarchy from flat file to BPC

    Hello SAP Guru,
    I have download customer / material  hierarchy in flat flie from BI/BW  and now I want to upload hierarchy from flat file to BPC
    Please can any one give me step by step method to load hierarchy from Flat file to SAP - BPC.
    Thanks in advance.
    With regards,
    Anand Kumar

    Hi Saida Reddy,
    why you resurrect a 5 years old thread? Surely he solved in the meanwhile his issue, see please dr Frankenstein.
    Regards
        Roberto

  • Random Records are being skipped while uploading data in PSA from CSV File

    Hi Experts,
    I am facing issue in data uploading in PSA through CSV file, Random Records are being skipped while uploading data in PSA.
    First Load
    We have flat file (.txt in CSV format), which contains 380240 Records.
    We are uploading the flat file data into PSA from Application Server. But it uploads Only 380235 records, 5 Records are being skipped.
    Second Load
    We have re-generated same file next day, which contains same No of Records (380240), but this time it uploads Only 380233 records, 7 Records are being skipped.
    We found 1 skipped record (based on key columns combination, by cross verifying from source and PSA table) from First load. But same records (combination of key column) is available in second load. It means same records are not being skipped every time.
    Earlier (5 months ago) , We have loaded 641190 Records from flat file in same PSA and all records (641190) were uploaded successfully.
    There is no change is Source, PSA and flat file structure.
    Thanks & Regards
    Bijendra

    Hi Bijendra,
        Please check in the file if at the begining if it has got any excape sign then that record may be skipped so the records may be mssing
    Please check the excape sign like ; if they are present at the beginign that recor entirely will be skipped.
    Regards
    vamsi

  • Error while uploading data to ztable from excel file

    Hi,
    I have a requirement where i have to upload data from excel file to ztable.I have used the fm 'ALSM_EXCEL_TO_INTERNAL_TABLE' for reading the excel file.After reading the excel file i have used INSERT zrb_hdr from table t_zrb_hdr for updating the ztable with data .
    here it is giving error as the data base table zrb_hdr and the internal table t_zrb_hdr should be declared of same type .
    I got this error b'coz i have changed the date and time fields in t_zrb_hdr table to char type.so the structure of zrb_hdr and t_zrb_hdr are not same.If i don't change the date and time fields,in the o/p i am not getting proper date and time formats.
    now how can i upload data into ztable?

    Hi,
    Try this.
    Data: itab type standard table of ztable,
             wa_itab type ztable.
    loop at t_zrb_hdr into wa_t_zrb_hdr.
       wa_itab-date = wa_t_zrb_hdr-date.
       wa_itab-time = wa_t_zrb_hdr-time.
       like  move all the fiedl to wa_itab...........
       append itab with wa_itab.
    Endloop.
    now insert the records from itab to the database table ztable.
    Thanks,
    Muthu.

  • Reading classification data of batchs from archiv files (MM75)

    Hi,
    At performance of archiving and deleted batch (object MM_SPSTOCK in SARA, Release 4.7), which have classification assignments (class type 022) there was a following situation: all batches in run with same material, have in index table for selection from archiv same offset, and at review of data of classification in transaction MM75 batch classification, charact values of classification are collected in one general list from all values batches on the same material in run. Besides, at viewing of a key of object of party on the screen classification in transaction MM75 (MATNR, WERKS, CHARG) it is visible incomplete batch number (3 signs from 10) only. Please support as to solve the given problem - it is required to have possibility of reading from  archiv file data for separate required batch, and in this case in archive the information has mixed up for all batches with an same material.
    Pls help.

    open a message at sap

  • Using image data read out from a file

    Hi,
    Having used the GetBitmapFromFileEx(), GetBitmapInfoEx() to acquire the necessary image data (most of them is the .png format), then using the FileToArray() to put the image data in my own binary file, e.g., "mypicture.dat". My idea is that whenever need to use the image, I can read out it from mypicture.dat and then display it on a pcture control.  But when loading the image data to the memory, I have no idea to map the image data buffer to an image resource, which can let to acquire a bitmap ID.  Because from the  cvi's image processing function lists, it seems that must through such as  the GetBitmapFromFileEx(), GetBitmapFromFile() to acquire the image data buffer and the bitmap ID, then using SetCtrlBitmap() to diplay it. Is there any way to resolve the problem? Thanks.
    David 

    Well, to read and write raw data file informations from a PNG image you must adhere to this standard. As a source of informations you may take a look to this Wikipedia page and to the links in this page from the PNG Home site.
    So the problem is: does your application worth the effort to study this documentation?
    Edit: FYI part of this job has been already made in CVI by Guillaume Dargaud for his ReadSavePNG instrument driver. It's been a long time since I have used this instrument, as I/O operations on PNG files have been integrated into CVI since release 8 and support for JPEG files in release 7 or so. Nevertheless I saw functions in that instrument for accessing raw data in a PNG file so you may find them useful for your needs.
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • Bulk Data - Insert / Update from text file - Urgent

    hi,
    Consider there is a Table A. There are around 1.7 Million
    Records.
    i have a situation that i will be getting the Data,
    Every two Weeks, around 100 - 200 thousand Records.
    I have to do some calculations.
    If any Old Data Exists, then update the Data
    for the Non - Primary Key Fields.
    Else
    I have to Insert the New Data.
    Most of the time, i will be getting update information.
    very few hundreds, insert records.
    Please, help me, by providing the techniques or tools.
    Is it posssible to automate the whole process.
    Sreedhar V
    null

    Sreedhar V (guest) wrote:
    : hi,
    : Consider there is a Table A. There are around 1.7 Million
    : Records.
    : i have a situation that i will be getting the Data,
    : Every two Weeks, around 100 - 200 thousand Records.
    : I have to do some calculations.
    : If any Old Data Exists, then update the Data
    : for the Non - Primary Key Fields.
    : Else
    : I have to Insert the New Data.
    : Most of the time, i will be getting update information.
    : very few hundreds, insert records.
    : Please, help me, by providing the techniques or tools.
    : Is it posssible to automate the whole process.
    : Sreedhar V
    Here's a process that might help:
    create a temporary table the same format as the flat file.
    create a sqlldr control file to load the data from the file into
    the temp table
    create a pl\sql or JAVA script to cursor through the records
    from the temp table and for each row see if there is a match on
    TABLE A. If so this is an update, if not it is an insert.
    If you are in a Unix environment you can write a shell script to
    automate the whole process and schedule it in kron.
    null

  • Separating a date read in from a file...

    I have a file which contains dates of birth in the form of 3 integers on each line, if I want to read in this line from the file and separate each (day,month,year), what is the easiest/best way to do this?
    The 'day' part of the date can either be stored as 1 or 2 digits depending on the date, same with the 'month', and the 'year' can either be stored as 2 digits or 4 digits. I was thinking of using substrings to get each part but obviously seeing as this is the case it would not work.
    Each part of the date is separated by a space.
    I also need to convert each part of the date to an integer.

    read in each line to a string and then use the String method split(" ") using the space as the delimiter. This will create an array of 3 strings (if there are three bits of data separated by spaces). You may have to trim these, then parse them. I'd look at the simpledateformat class as well.

  • Load Master Data to BPC from a file in BW server

    Hi all,
    the problem is the next one. We have create some files in Bw with APD. We left those files in a carpet in the Bw server. We want to load those files in BPC. Anyone can explain how we can upload those files?
    Thanks for the help.
    Gorka.

    Hi Gorka,
    Please find the link for the document, which explains you "Loading Master data from BW to BPC"
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/00380440-010b-2c10-70a1-e0b431255827?quicklink=index&overridelayout=true
    I hope this may help you.
    Raghu B.S.

  • Data Migration tool from legacy file sys to iFS

    Is there an existing tool used for
    data migration from a lagacy file system
    to iFS?
    Thanks in advance for any sugesstions..
    Elvis...

    Hi Elvis,
    Not at the moment, but I'll be happy to log it as an enhancement request for the future, please post your requirements for more details.

  • Solution Manager data upload/synchronize from SMSY to Marketplace

    Hi Experts,
    One of our SAP System data has got deleted from SAP Marketplace system data maintenance section. The data is available in SMSY transaction of our solution manager system.
    I would like to know if there is any way that we can populate/synchronize  the data available in SMSY to Marketplace System Data.
    Please advice on this.
    Rg,
    Sandeep.

    Hi Anil,
    This issue is resolved now and i was able to populate data from SMSY to System data in marketplace.
    using SMSY - select system - system data in support portal - synchronize.
    It uploaded data from SMSY to OSS and all details are visible now.
    Rg,
    Sandeep.

  • BO Data Services - Reading from excel file and writing to SQL Server Table

    Hi,
    I would like to read data from an excel file and write it to a SQL Server Data base table without making any transformations using Data Services. I have created an excel file format as source and created target table in SQL Server. The data flow will just have source and target. I am not sure how to map the columns between source and target. Appreciate your quick help in providing a detailed steps of mapping.
    Regards,
    Ramesh

    Ramesh,
    were you able to get this to work? if not, let me know and I can help you out with it.
    Lynne

  • Loading data for heirarchies from flat file.

    Hi,
    I am trying to load heirarchies from a flat file. I am getting the error "Error during the calculation at the node level".
    I am not able to get the reason.I am also scpetical about this
    1.Is it necessary that the external characterics whic are used in heirarchy should already contain data?
    2.Should we create a root node before loading the data? Or will it create everything itself during the loading.
    3. Should this heirarchies be created directly on the productive system.
    regards
    Mandha

    Hi,
    http://help.sap.com/erp2005_ehp_03/helpdata/EN/fa/e92637c2cbf357e10000009b38f936/frameset.htm
    GTR

  • How can I transfer dates and locations from excel file to iCal?

    I received an Excel file with dates and locations to visit for 45 days. Is there a way to transfer over to iCAL and then to iPhone?

    how to input all those addresses into my Garmin as well.
    I can't help you with that one.
    Could have I also input somehow from excel to entourage and then ical??
    I don't think Entourage has the data detectors feature.
    AK

Maybe you are looking for

  • ALE: how do I use dependent distribution for customer and vendor addresses?

    Hello SDN'ers Hopefully someone can help me with an ALE question. We have two ERP systems connected with ERP - Retail and AFS. Customers and Vendors may be created in Retail, and are distributed to AFS using DEBMAS, CREMAS and ADRMAS messages. Not al

  • Not reading cds/dvds

    Hi well its almost a year that i have had my mac mini (april 08 will b a year) and i noticed that the other day when i inserted a movie dvd to watch it was making weird loud noises. so i thought nothing of it and ejected it, then i tried putting it b

  • I have a prepaid plan with verizion and want to switch my phone to an I Phone. Can that be done

    My husband bought an Apple I Phone from his Co worker. He reset the phone and now it says there is no Sim Card, which I knew. So it can only make emergency calls. We are on a pre paid service with Verizion and I want to be able to use my I Phone. I c

  • Radar plot with category label changed

    Hi I tried this example vi, Line Graph (Excel).vi, with some modification as shown in the attached picture. I changed the plot to a xlRadar. After I run the vi, I got the result as shown in another attached picture. I would like to know how to change

  • Error when trying to import and burn

    I get the following message when I try to start up iTunes: Warning! The registry settings used by the iTunes drivers for importing and burning CDs and DVDs are missing. This can happen as a result of installing other CD burning software. Please reins