Load the XML of the DB table

Hello world

I have a urgent need of loading XML from the Oracle table... pls let me know how to achieve this.

I know that the overthrow of the same thing but impossible to continue any further with this req

(ODI: 11.1.1.5, operating system: Solaris, DB: Oracle 11 g)

Kind regards

M

Its resolved, use sqlunloader.

I saw these videos Chantal, thanks for your help

Tags: Business Intelligence

Similar Questions

  • When to load the external table condition


    Hello

    Is my version of db: oracle 11g

    I have a 6 gig csv file.

    I divided it several 15 MB csv files.

    But only the first csv file has header (with column headers).

    I have to load each of these files into a target table.

    I created an external table with jump 1.

    But how can I substitute jumping 1 for other csv files.

    Is there a way I can do it in the external table definition.

    I can't merge the split csv files and run as one big file. So I don't hv this option. Please advice.

    You should be able to use the LOAD WHEN clause to exclude a line based on the contents of a field. Or the other

    WHEN LOAD 1 / 2! = "ID".

    or, if the bonds are quoted,

    WHEN LOAD 1:4! = « « ID » »

    or you can always add a list of fields to your specifications and the names of the fields in the reference LOAD WHEN the condition instead of using an absolute position.

    Don't know if you saw my comments on the use of the tail command before you replied, but if the break-up of the file is part of your project of automated process, and then deleting the header row could certainly be integrated into this process if your on a unix platform and using the split command to split the file.

    Kind regards

    Bob

  • How to load the child table by using a simple slider...?

    How can I loa the child table by using a PL/SQL block cursor...

    for example, I have a table of the source called method

    EmpNo, empname, deptid deptname

    and I have 2 tables of taget... EMP and Dept.

    EMP
    ===
    EmpNo, empname, deptid

    Dept
    ====
    deptID, deptname


    Here, I want to load method for emp data and... Dept where dept does not contain data in double...

    For now... I used the cursor and in the same cursor, I'm loading data first dept table and then to the emp table.
    I use for dept, exceptional setting, which will manage a PK constraint violation error by doing nothing...

    in this way, there will be no duplicates... but it is not advisable because I 15,00,000 lines in the method table.

    Is there another way to do it?

    OK, I'd probably go with the method two insert, but as an alternative, here's a way to do it in a single insert:

    create table emp_info as
    select 1 empno, 'a' empname, 101 deptid, 'aaa' deptname from dual union all
    select 2, 'b' empname, 201 deptid, 'bbb' deptname from dual union all
    select 3, 'c' empname, 101 deptid, 'aaa' deptname from dual union all
    select 4, 'd' empname, 101 deptid, 'aaa' deptname from dual union all
    select 5, 'e' empname, 301 deptid, 'ccc' deptname from dual;
    
    create table emp (empno number primary key, empname varchar2(3), deptid number);
    
    create table dept (deptid number primary key, deptname varchar2(3));
    
    insert all
      WHEN rn = 1 THEN
           into dept (deptid, deptname)
           values (deptid, deptname)
      WHEN rn > 0 THEN
           into emp (empno, empname, deptid)
           values (empno, empname, deptid)
    select empno, empname, deptid, deptname, rn
    from   (select empno,
                   empname,
                   deptid,
                   deptname,
                   row_number() over (partition by deptid order by empno) rn
            from   emp_info);
    
      8 rows inserted
    
    commit;
    
    select * from emp;
    
         EMPNO EMP     DEPTID
    ---------- --- ----------
             1 a          101
             3 c          101
             4 d          101
             2 b          201
             5 e          301
    
    select * from dept;
    
        DEPTID DEP
    ---------- ---
           101 aaa
           201 bbb
           301 ccc
    

    You must test these two methods to see which is more efficient.

  • Loading nested XML file to a table

    Hi I have the following XML code.

    -< protocols >
    -Protocol of <>
    < name > SampleAddition_Outer < / name >
    < revision > 0 < / revision >
    -< ProtocolSteps >
    -< ProtocolStep >
    < name > SampleAddition < / name >
    < EnumProtocolStep > SampleAddition < / EnumProtocolStep >
    SampleProbe < action > < / Action >
    -< ParameterList >
    < string > SampleDispVol < / string >
    < string > SampleOverAspVol < / string >
    < string > LeadAirGap < / string >
    < string > TrailAirGap < / string >
    < string > SPPumpAspSpeed < / string >
    < string > SPPumpDispSpeed < / string >
    < string > SPPumpDispHeight < / string >
    < / ParameterList >
    < IntAction > 0 < / IntAction >
    < IntProtocolStep > 0 < / IntProtocolStep >
    < SequenceName > EmptySequence < / SequenceName >
    < / ProtocolStep >
    < / ProtocolSteps >

    This XML file is repeated over and over again in the large file.
    This is a nested structure and I want to store in a table so that the columns as follows

    Nom_protocole = SampleAddition_Outer, review = 0, ProtocolStep_Name = SampleAddition, EnumProtocolStep = SampleAddition, SampleProbe = Action, ParameterList is SampleDispVol
    Nom_protocole = SampleAddition_Outer, review = 0, ProtocolStep_Name = SampleAddition, EnumProtocolStep = SampleAddition, SampleProbe = Action, ParameterList is SampleOverAspVol
    Nom_protocole = SampleAddition_Outer, review = 0, ProtocolStep_Name = SampleAddition, EnumProtocolStep = SampleAddition, SampleProbe = Action, ParameterList is LeadAirGap
    Nom_protocole = SampleAddition_Outer, review = 0, ProtocolStep_Name = SampleAddition, EnumProtocolStep = SampleAddition, SampleProbe = Action, ParameterList is TrailAirGap
    Nom_protocole = SampleAddition_Outer, review = 0, ProtocolStep_Name = SampleAddition, EnumProtocolStep = SampleAddition, SampleProbe = Action, ParameterList is SPPumpAspSpeed
    Nom_protocole = SampleAddition_Outer, review = 0, ProtocolStep_Name = SampleAddition, EnumProtocolStep = SampleAddition, SampleProbe = Action, ParameterList is SPPumpDispSpeed
    Nom_protocole = SampleAddition_Outer, review = 0, ProtocolStep_Name = SampleAddition, EnumProtocolStep = SampleAddition, SampleProbe = Action, ParameterList is SPPumpDispHeight

    I understand that this table would be very standard but its OK for me now.

    I use oracle 10g.

    I loaded the entire xml in the unique xmltype column and used the following query to retrieve it.

    Select extractvalue (value (x), ' / Protocol/Name ") Nom_protocole,.
    ExtractValue (value (x), ' / ProtocolSteps/protocol/name of the Protocol / ") protocolstep_name
    of gt_xmltype_tab1 gt, TABLE (XMLSequence (extract (gt.xmlfile1, ' / Protocols/Protocol/ProtocolSettings '))) x;


    But it shows only Nom_protocole in the output. There is no error in the execution, but the output is not good either.
    I use Oracle 10 g

    Could someone help out here?

    If I understand correctly, you have three levels unnest here, so you need three nested XMLSequence:

    SQL> create table tmp_xml of xmltype;
    
    Table created
    
    SQL>
    SQL> insert into tmp_xml values(
      2  xmltype(
      3  '
      4    
      5      SampleAddition_Outer
      6      0
      7      
      8        
      9          SampleAddition
     10          SampleAddition
     11          SampleProbe
     12          
     13            SampleDispVol
     14            SampleOverAspVol
     15            LeadAirGap
     16            TrailAirGap
     17            SPPumpAspSpeed
     18            SPPumpDispSpeed
     19            SPPumpDispHeight
     20          
     21          0
     22          0
     23          EmptySequence
     24        
     25      
     26    
     27  ')
     28  );
    
    1 row inserted
    
    SQL>
    SQL> select extractValue(value(x1), '/Protocol/Name') as Protocol_Name
      2       , extractValue(value(x1), '/Protocol/Revision') as Revision
      3       , extractValue(value(x2), '/ProtocolStep/Name') as ProtocolStep_Name
      4       , extractValue(value(x2), '/ProtocolStep/EnumProtocolStep') as EnumProtocolStep
      5       , extractValue(value(x2), '/ProtocolStep/Action') as Action
      6       , extractValue(value(x3), '/string') as ParameterList
      7  from tmp_xml t
      8     , table(xmlsequence(extract(t.object_value, '/Protocols/Protocol'))) x1
      9     , table(xmlsequence(extract(value(x1), '/Protocol/ProtocolSteps/ProtocolStep'))) x2
     10     , table(xmlsequence(extract(value(x2), '/ProtocolStep/ParameterList/string'))) x3
     11  ;
    
    PROTOCOL_NAME             REVISION   PROTOCOLSTEP_NAME  ENUMPROTOCOLSTEP   ACTION         PARAMETERLIST
    ------------------------- ---------- ------------------ ------------------ -------------- -------------------
    SampleAddition_Outer      0          SampleAddition     SampleAddition     SampleProbe    SampleDispVol
    SampleAddition_Outer      0          SampleAddition     SampleAddition     SampleProbe    SampleOverAspVol
    SampleAddition_Outer      0          SampleAddition     SampleAddition     SampleProbe    LeadAirGap
    SampleAddition_Outer      0          SampleAddition     SampleAddition     SampleProbe    TrailAirGap
    SampleAddition_Outer      0          SampleAddition     SampleAddition     SampleProbe    SPPumpAspSpeed
    SampleAddition_Outer      0          SampleAddition     SampleAddition     SampleProbe    SPPumpDispSpeed
    SampleAddition_Outer      0          SampleAddition     SampleAddition     SampleProbe    SPPumpDispHeight
    
    7 rows selected
     
    

    Assuming you're on 10.2 you can use XMLTable as well, easier to implement IMO, but on a large XML document may not perform as well as XMLSequence if the XMLType table is not based on a schema.
    Major improvements in the treatment of the XQuery were made from 11 g when using tables not based on a schema.

  • Save and load the string table

    Hello

    is possible except an array of channel with multiple line of text file and load new file to table with the same size of array?

    Because when I use the code in the picture, initialized array is 3 x 3 but after save and load file is table 5 x 3.

    If is an option how to save this table in the file into 3 x 3 table and charge back of file as a 3 x 3 table?

    Thank your for any suggestion,.

    Petr

    Your code is loaded in 5 x 3 is because two of your cells have newline characters (\n). The reading of the worksheet VI use return or line break characters and your delimiter to figure out how to split the string into an array.

    A solution might be to replace all characters from end of line with something else, and then reinsert it after reading of the worksheet.

    It can do what you want, even if it's a bit bulky. It's a little confusing if you don't understand "------" string formatting, but it essntially replaces all '\r' and '\n' with '\\r' and '\\n', including the conversion of the worksheet does not read as an end of line character.

  • Avoid loading the audit tables when we run a mapping.

    When we run the OWB cards, some tables of verification in the repository of the runtime are loaded with statistics of the
    the execution plan. Is it possible to avoid the loading of these audit tables when we run the cards?

    Here are the steps to do:
    1. right-click on the map.
    2. click on configure.
    3. Select settings of race time.
    4. Select the level of auditing by default to none.

  • Error loading the external table

    I encounter an error.

    IAF.txt:

    "02T001427T04206"-1
    '478081' 12
    '131379' 200
    "158125"-100
    '152040'-800
    "151112"-4
    '481990'-5
    "150389"-300
    "481136" 3


    CREATE OR REPLACE DIRECTORY IAF_log_dir
    LIKE 'c:\dataformats\logs\IAF\log ';
    CREATE OR REPLACE DIRECTORY IAF_bad_dir
    LIKE 'c:\dataformats\logs\IAF\bad ';
    create table ext_IAF_table)
    item_no varchar2 (15).
    integer quantity
    )
    external organization
    (
    type oracle_loader
    default directory user_dir
    access settings
    (
    records delimited by newline
    FIELDS TERMINATED BY WHITESPACE EVENTUALLY SURROUNDED "" "
    BadFile IAF_bad_dir:'IAF%a_%p.bad'
    logfile IAF_log_dir:'IAF%a_%p.log'
    fields
    (
    item_no char (15),
    external quantity integer
    )
    )
    location ("IAF.txt")
    )
    reject limit unlimited;


    SQL > select * from ext_iaf_table;
    Select * from ext_iaf_table
    *
    ERROR on line 1:
    ORA-29913: error in executing ODCIEXTTABLEOPEN legend
    ORA-29400: data cartridge error
    KUP-00554: error occurred when parsing the access settings
    KUP-01005: syntax error: found "badfile": waiting for an of: "and in the column, (,»
    LTrim lrtrim, ldrtrim, lack, notrim, rtrim, reject.
    KUP-01007: line 3, column 1
  • Load an XML nested in a table nested PL/SQL (associative)

    Hello

    I'm fairly new to XML in PL/SQL and dealing with a complex case as follows:

    < Message >

    < HEADER >

    SW20130102-01 of < Filename > < / name >

    SWITCH < FILE_TYPE > < / Type_de_fichier >

    < / Header >

    < BODY >

    < POLICY_LIST >

    <>POLICY

    CLIENT < INSTRUCTION_SOURCE > < / INSTRUCTION_SOURCE >

    < POLICY_NO > 401-002298 < / POLICY_NO >

    < SWITCH_LIST >

    < SWITCH >

    < COMMON_ID > 101 < / COMMON_ID >

    < SWITCH_TYPE > P < / SWITCH_TYPE >

    < SWITCH_CHARGE > 100,00 < / SWITCH_CHARGE >

    < EFFECTIVE_DATE > < / EFFECTIVE_DATE >

    < FUND_LIST >

    < FUND >

    < FUND_CODE > 1069 < / FUND_CODE >

    < INVEST_MODEL > 1 < / INVEST_MODEL >

    < > 100,00 PERC < / PERC >

    < AMOUNT > < / AMOUNT >

    SELL < BUY_SELL > < / BUY_SELL >

    < / FUND >

    < FUND >

    < FUND_CODE > 1003001 < / FUND_CODE >

    < INVEST_MODEL > 1 < / INVEST_MODEL >

    < > 50.00 PERC < / PERC >

    < AMOUNT > < / AMOUNT >

    < SWITCH_CHARGE > 25.00 < / SWITCH_CHARGE >

    N < traded > < / SHARED >

    BUY < BUY_SELL > < / BUY_SELL >

    < / FUND >

    < FUND >

    < FUND_CODE > 1070 < / FUND_CODE >

    < INVEST_MODEL > 1 < / INVEST_MODEL >

    < > 50.00 PERC < / PERC >

    < AMOUNT > < / AMOUNT >

    < SWITCH_CHARGE > 75.00 < / SWITCH_CHARGE >

    N < traded > < / SHARED >

    BUY < BUY_SELL > < / BUY_SELL >

    < / FUND >

    < / FUND_LIST >

    < / SWITCH >

    < SWITCH >

    < COMMON_ID > 102 < / COMMON_ID >

    < SWITCH_TYPE > P < / SWITCH_TYPE >

    < SWITCH_CHARGE > 100,00 < / SWITCH_CHARGE >

    < EFFECTIVE_DATE > < / EFFECTIVE_DATE >

    < FUND_LIST >

    < FUND >

    < FUND_CODE > 1055 < / FUND_CODE >

    < INVEST_MODEL > 1 < / INVEST_MODEL >

    < > 100,00 PERC < / PERC >

    < AMOUNT > < / AMOUNT >

    SELL < BUY_SELL > < / BUY_SELL >

    < / FUND >

    < FUND >

    < FUND_CODE > 1003012 < / FUND_CODE >

    < INVEST_MODEL > 1 < / INVEST_MODEL >

    < > 50.00 PERC < / PERC >

    < AMOUNT > < / AMOUNT >

    < SWITCH_CHARGE > 25.00 < / SWITCH_CHARGE >

    N < traded > < / SHARED >

    BUY < BUY_SELL > < / BUY_SELL >

    < / FUND >

    < FUND >

    < FUND_CODE > 1068 < / FUND_CODE >

    < INVEST_MODEL > 1 < / INVEST_MODEL >

    < > 50.00 PERC < / PERC >

    < AMOUNT > < / AMOUNT >

    < SWITCH_CHARGE > 75.00 < / SWITCH_CHARGE >

    N < traded > < / SHARED >

    BUY < BUY_SELL > < / BUY_SELL >

    < / FUND >

    < / FUND_LIST >

    < / SWITCH >

    < / SWITCH_LIST >

    < / POLICY >

    <>POLICY

    CLIENT < INSTRUCTION_SOURCE > < / INSTRUCTION_SOURCE >

    < POLICY_NO > 401-002300 < / POLICY_NO >

    < SWITCH_LIST >

    < SWITCH >

    < COMMON_ID > 101 < / COMMON_ID >

    < SWITCH_TYPE > P < / SWITCH_TYPE >

    < SWITCH_CHARGE > 100,00 < / SWITCH_CHARGE >

    < EFFECTIVE_DATE > < / EFFECTIVE_DATE >

    < FUND_LIST >

    < FUND >

    < FUND_CODE > 1090 < / FUND_CODE >

    < INVEST_MODEL > 1 < / INVEST_MODEL >

    < > 100,00 PERC < / PERC >

    < AMOUNT > < / AMOUNT >

    SELL < BUY_SELL > < / BUY_SELL >

    < / FUND >

    < FUND >

    < FUND_CODE > 1091 < / FUND_CODE >

    < INVEST_MODEL > 1 < / INVEST_MODEL >

    < > 50.00 PERC < / PERC >

    < AMOUNT > < / AMOUNT >

    < SWITCH_CHARGE > 25.00 < / SWITCH_CHARGE >

    N < traded > < / SHARED >

    BUY < BUY_SELL > < / BUY_SELL >

    < / FUND >

    < FUND >

    < FUND_CODE > 1092 < / FUND_CODE >

    < INVEST_MODEL > 1 < / INVEST_MODEL >

    < > 50.00 PERC < / PERC >

    < AMOUNT > < / AMOUNT >

    < SWITCH_CHARGE > 75.00 < / SWITCH_CHARGE >

    N < traded > < / SHARED >

    BUY < BUY_SELL > < / BUY_SELL >

    < / FUND >

    < / FUND_LIST >

    < / SWITCH >

    < SWITCH >

    < COMMON_ID > 103 < / COMMON_ID >

    < SWITCH_TYPE > P < / SWITCH_TYPE >

    < SWITCH_CHARGE > 100,00 < / SWITCH_CHARGE >

    < EFFECTIVE_DATE > < / EFFECTIVE_DATE >

    < FUND_LIST >

    < FUND >

    < FUND_CODE > 1069 < / FUND_CODE >

    < INVEST_MODEL > 1 < / INVEST_MODEL >

    < > 100,00 PERC < / PERC >

    < AMOUNT > < / AMOUNT >

    SELL < BUY_SELL > < / BUY_SELL >

    < / FUND >

    < FUND >

    < FUND_CODE > 1003001 < / FUND_CODE >

    < INVEST_MODEL > 1 < / INVEST_MODEL >

    < > 50.00 PERC < / PERC >

    < AMOUNT > < / AMOUNT >

    < SWITCH_CHARGE > 25.00 < / SWITCH_CHARGE >

    N < traded > < / SHARED >

    BUY < BUY_SELL > < / BUY_SELL >

    < / FUND >

    < FUND >

    < FUND_CODE > 1070 < / FUND_CODE >

    < INVEST_MODEL > 1 < / INVEST_MODEL >

    < > 50.00 PERC < / PERC >

    < AMOUNT > < / AMOUNT >

    < SWITCH_CHARGE > 75.00 < / SWITCH_CHARGE >

    N < traded > < / SHARED >

    BUY < BUY_SELL > < / BUY_SELL >

    < / FUND >

    < / FUND_LIST >

    < / SWITCH >

    < / SWITCH_LIST >

    < / POLICY >

    < / POLICY_LIST >

    < / BODY >

    < / MSG >

    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    In this XML file, I have a POLICY_LIST tag that may have one or more political entities. Each political entity has a SWICH_LIST that could have multiple SWITCHES. And each SWITCH has a FUND_LIST with several funds. With a lot of research on the net I found the following way to read this XML only once in a PL/SQL table as follows

    Select p.policy_no

    p.instruction_source

    s.common_id

    s.switch_type

    s.switch_charge

    s.effdate

    f.fund_code

    f.invest_model

    f.buy_sell

    f.perc

    f.amount

    f.fund_switch_charge

    bulk collect into v_temp_switch_tab

    from xmltable ('/ MSG/BODY/POLICY_LIST/POLICY ' from v_request_xml)

    path of columns policy_no varchar2 (20) "POLICY_NO".

    , path of varchar2 (50) instruction_source 'INSTRUCTION_SOURCE '.

    , path of xmltype switch_list "SWITCH_LIST".

    ) p

    , xmltable (' SWITCH_LIST/SWITCH ' in passing p.switch_list)

    path of columns common_id varchar2 (50) 'COMMON_ID '.

    , path of varchar2 (1) switch_type "SWITCH_TYPE.

    , path number switch_charge "SWITCH_CHARGE".

    , path is effdate "EFFECTIVE_DATE".

    , path of xmltype fund_list "FUND_LIST".

    + 1

    , xmltable (' FUND_LIST/FUND ' in passing s.fund_list)

    path of columns fund_code varchar2 (10) 'FUND_CODE '.

    , path number invest_model "INVEST_MODEL".

    , path number perc "PERC."

    , path number amount 'AMOUNT '.

    , path of varchar2 (10) buy_sell 'BUY_SELL '.

    path number fund_switch_charge 'SWITCH_CHARGE') f;

    --------------------------------------------------------------------------

    Problem with this approach is that I have to depend on one of the tag values to separate several tags switch on the same label POLICY. Is there a better way to do it? as by reading the XML in one go (collect in bulk) and obtaining of the link based on the grouping of tags in the XML of entry? Hope my explanation of the issue at hand is clear

    Thank you very much for taking the time to understand it.

    Parag

    Hey guys

    A BIG Thank YOU to you two to help out me!

    The clause ordinalite does the trick.

    Thanks again

    Parag

  • Load the XML complecated file into my DATABASE

    Hello everyone,
    I have an XML file structured like:
    < ROOT_ELEMENT >
    < SUB_ROOT name = "RETOUR_REQ" >
    < tag name = "TAG1" id = "1" >
    < TAG_VALUE > V1 < / TAG_VALUE >
    < / TAG >
    < tag name = "TAG2" id = "2" >
    < TAG_VALUE > V2 < / TAG_VALUE >
    < / TAG >
    < tag name = "TAG3" id = "3" >
    V3 < TAG_VALUE > < / TAG_VALUE >
    < / TAG >
    < / SUB_ROOT >
    < / ROOT_ELEMENT >

    I want to load this XML file in my Oracle 10 g, the structure of the target table is:


    CREATE TABLE IMP_XML_RETOUR)
    FLUX_NAME VARCHAR2 (20), == > tag mapping
    ELMENT_1 VARCHAR2 (20), == >
    ELMENT_2 VARCHAR2 (20), == >
    ELMENT_3 VARCHAR2 (20) == >
    );
    the FLUX_NAME field must be mapped to the path 'ROOT_ELEMENT/SUB_ROOT/@name '.
    the ELMENT_1 field must be mapped to the path 'ROOT_ELEMENT/SUB_ROOT/TAG@name='TAG1'/TAG_VALUE '.
    the ELMENT_2 field must be mapped to the path 'ROOT_ELEMENT/SUB_ROOT/TAG@name='TAG2'/TAG_VALUE '.
    the ELMENT_3 field must be mapped to the path 'ROOT_ELEMENT/SUB_ROOT/TAG@name='TAG3'/TAG_VALUE '.

    There are any PLSQL function that can be used to load my XML file into my table

    Thanks a lot for your answers

    OK, so my example should work for you.

  • Load the XML file into oracle using sql loader

    Hello

    I'm trying to load an xml file into a table using sqlldr.
    I have a table as follows:
    CREATE TABLE xmlloadtable
    ( id number,
     data_xml XMLType
     )
      XmlType data_xml STORE AS CLOB;
    I have a control file that I know is perfectly false:
    LOAD DATA 
    INFILE '/home/oraread/'
    INTO TABLE xmlloadtable 
    (
    id,
    data_xml 
    )
    I googled for the file control and tried in different ways, but of no use.
    I want to load the entire xml file into the table.
    Can someone help me with the correct control file. Any help is appreciated!

    Try this

    LOAD DATA
    INFILE '/home/oraread/'
    INTO TABLE xmlloadtable
    (id,
     file_name          filler,
     data_xml          lobfile(file_name) terminated by eof
    )
    

    You can add the file as a column name field to your table between the id and xml column and remove the word to fill in the .ldr file if you need to keep the name of the file

  • How to use SQL * Loader to load the XMLType column with other columns?

    Hello

    I try to use sqlldr to load an XML file into a table with an XMLType column. I have found many examples where the entire table is an xmltype, but I'd like to load a lot of XML objects in a generic table for treatment with a single XMLType column and other columns to identify the load. A simple example, I have a constant column which I want to put during the download.

    The following example does not work: (.) No error either.

    create the table xml_upload
    (the varchar2 (10) of upload_type not null,)
    donnees_xml XMLType)
    /

    my control file:
    DOWNLOAD THE DATA
    INFILE * add
    IN THE TABLE xml_upload
    XMLType (xml_data)
    FIELDS ENDED BY ',' POSSIBLY FRAMED BY "" "
    (
    constant upload_type MARKET,
    donnees_xml
    )
    BEGINDATA
    < SALE_ORDER >
    TIM < CUST_CODE > < / CUST_CODE >
    < ORDER_NUM > 1234 > < / ORDER_NUM >
    < / SALE_ORDER >


    $ sqlldr my.ctl

    SQL * Loader: Release 10.2.0.4.0 - Production on Sun Sep 27 22:51:52 2009

    Copyright (c) 1982, 2007, Oracle. All rights reserved.

    Commit the point reached - the number of logical records 4

    SQL > select * from xml_upload;
    no selected line
    SQL >

    Any ideas on how I can do this? Did I miss something...

    I also played with the clause sqlldr lobfile, also without success.

    Current database version is 10g R2.

    Thank you
    Tim.

    The following works in 11.1.0.6

    LOAD DATA
    INFILE *
    INTO TABLE xml_upload TRUNCATE
    (
     upload_type constant 'MARKET'
    ,file_name filler char(100)
    ,xml_data LOBFILE (file_name) TERMINATED BY EOF
    )
    BEGINDATA
    test.xml
    
    SQL> select upload_type,xmlserialize(document xml_data no indent) from xml_upload;
    
    UPLOAD_TYP XMLSERIALIZE(DOCUMENTXML_DATANOINDENT)
    ---------- ----------------------------------------------------------------------
    MARKET        1
    
    SQL> 
    
  • data and loading the script sale scheme

    Hello
    I'm learning OBIEE on mine. I managed to install oracle XE and OBIEE 10 g. I need a script to create a new db schema and load the dirty tables with sample data to create reports. can someone help me with scripts?

    Yes, I confirmed that only one Enterprise for Oracle Db edition has the SH schema enabled during installation... you can't have the SH schema without this feature which is ONLY on the Enterprise Edition.

    Here is the article: http://www.dba-oracle.com/t_callan_schema_bye_scott.htm

    Please install the full Enterprise edition and select the SEED DB on install. You will have the sh schema

    If it was OK, please mark as correct.

  • MAXL set out in the export table Alias

    I'm having a hard time finding the correct MaxL to export and table alias - basically, I need to export the default table, shift some periods and years and then recharge it in a table different aliases. Any help is appreciated!

    [email protected]!

    Interseting suddenly to look I can find the command to load the alias table, but not to extract it

    Change the load database table_alias table_alias form name data_file file_name

    OK, I found it but not where I expected, it
    Try
    database query 'Sample'.' Basic ' list of alias_names in "default" table_alias

  • Load the XML file into Oracle external Table


    I load the data from the XML file into an intermediate table Oracle using external Tables.

    Let's say below, it is my XML file

    < header >
    < A_CNT > 10 < / A_CNT >
    < E_CNT > 10 < / E_CNT >
    < AF_CNT > 10 < / AF_CNT >
    < / header >
    < student >
    <>students-details
    < Student_info >
    < Single_Info >
    < ID > 18 / < ID >
    New York < City > < / City >
    < country > United States < / country >
    < Name_lst >
    < Student_name >
    Samuel < name > < / name >
    Paul < Last_name > < / Last_name >
    < DOB > 19871208 < / DOB >
    Aware of < RecordStatus > < / RecordStatus >
    < / Student_name >
    < Student_name >
    Samuel < name > < / name >
    Paul < Last_name > < / Last_name >
    < DOB > 19871208 < / DOB >

    < TerminationDt > 20050812 < / TerminationDt >
    History of < RecordStatus > < / RecordStatus >
    < / Student_name >
    < / Name_lst >
    < Personal_Info >
    <>men < / Type >
    < 27 > < / Age >
    < / Personal_Info >
    < / Single_Info >
    < / Student_info >

    < student - register >
    class < A >
    < info >
    < detail >
    < ID student > 18 < / student >
    EE < major > < / Major >
    < course-Grades >
    < course > VLSI < / course >
    < degree > 3.0 < / Grade >
    < / course-Grades >
    < course-Grades >
    < course > nanotechnology < / course >
    < degree > 4.0 < / Grade >
    < / course-Grades >
    < / details >
    < detail >
    < ID student > 18 < / student >
    THIS < major > < / Major >
    < / details >
    < / info >
    class < A >
    < Student_Enrol >
    <>students-details
    < student >

    I load this XML data file into a single table using an external Table. Could someone help me please with coding.

    Thank you

    Reva

    Could you please help me how to insert my XML content into that.

    Same as before, try a plain old INSERT:

    insert into xml_pecos

    values)

    XmlType (bfilename ('XML_DIR', "test.xml"), nls_charset_id ('AL32UTF8'))

    );

    But you'll probably hit the same limitation as with the binary XMLType table.

    In this case, you can use FTP to load the file as a resource in the XML DB repository.

    If the XML schema has been registered with the hierarchy enabled then the file will be automatically inserted into the table.

    Could you post the exact statement that you used to save the scheme?

    In the meantime, you can also read this article, I did a few years ago, it covers the XML DB features that may be useful here, including details on how to load the file via FTP:

    https://odieweblog.WordPress.com/2011/11/23/Oracle-XML-DB-a-practical-example/

    And documentation of the course: http://docs.oracle.com/cd/E11882_01/appdev.112/e23094/xdb06stt.htm#ADXDB4672

  • Loading XML into the relational Table data

    Hello

    I get a generated XML file to other tools (Windows), I am trying to create a Linux shell script that will gather the necessary XML file to my Linux server, then ask Oracle to use this file to load the XML data into a relational table. This activity and the data will be needed on an ongoing basis.

    I tried two ways. First, I loaded the XML document into the database and tried to extract the data directly from the document, but it does not work. Now I want to try to read the data directly from the file on the server through select, however I don't get all the returned data. In the Select statement below, I am trying to query the data to see what is returned for my tests.

    Create Table ci_results_table (transactionID Varchar2 (100), //transactionID should be PrimaryKey but became errors in test of insert, PK so deleted NULL value)

    message Varchar2 (200),

    This Varchar2 (50).

    XMLType of the ProcessedDate,

    status Varchar2 (50).

    sourceFile VarChar2 (100));

    Select x.*

    from XMLTable)

    ' TSPLoadResults/results '.

    PASSAGE xmltype (bfilename('CMDB_DEVADHOCRESULTS_DIR','LoadResults-HP_146.results.xml'), nls_charset_id ('AL32UTF8'))

    COLUMNS

    transactionID PATH Varchar2 (100) 'TransactionID '.

    Result XMLType PATH 'result ',.

    Message Varchar2 (200) PATH "Message."

    PrimaryKey Varchar2 (50) PATH "PrimaryKey"

    Date of ProcessedDate path "ProcessedDate."

    Status Varchar2 (50) PATH "Status."

    SourceFile VarChar2 (100) PATH "SourceFileName.

    ) x

    ;

    Eventually, I'll have to build on that to limit the returned data to records where SourceFileName is like '% PA' and insert what is returned in to the ci_results_table. Attached is an example of the XML results file I am trying to load, it is named "ResultsTransformedtoUnix" because I used dos2Unix to convert Unix which can be good or bad. (I send the output file must be converted to the format BACK until the other application can read). Original (before converting Unix) file named in the script is also attached.

    Help, please. Thank you!

    Hello

    I see some bad things in your query.

    (1) obvious one, explaining why you get all the data: there is a typing error in the XQuery expression, there 'result' not'slead.

    (2) ProcessedDate can be extracted as a date (at least not directly) because it actually represents a timestamp, use the TIMESTAMP WITH time ZONE HOURS and cast back to DATE data type in the SELECT clause

    (3) transactionID is an attribute, it must be accessible with ' @' (or ' attribute:' axis)

    (4) if the encoding of file really is ISO-8859-1 as suggested in the prologue, then do not use AL32UTF8 but the name of the corresponding character set: WE8ISO8859P1

    Here is the query to work:

    select x.transactionID
         , x.Message
         , x.Primarykey
         , cast(x.ProcessedDate as date) ProcessDate
         , x.Status
         , x.SourceFile
    from XMLTable(
           '/TSPLoadResults/Result'
           PASSING xmltype(bfilename('XML_DIR','LoadResults-HP_146.results.xml'), nls_charset_id('WE8ISO8859P1'))
           COLUMNS
             transactionID Varchar2(100)            PATH '@transactionID',
             Message       Varchar2(200)            PATH 'Message',
             PrimaryKey    Varchar2(50)             PATH 'PrimaryKey',
             ProcessedDate timestamp with time zone PATH 'ProcessedDate',
             Status        Varchar2(50)             PATH 'Status',
             SourceFile    VarChar2(100)            PATH 'SourceFileName'
         ) x
    ;
    

    Directly on the file using this query will only be decently (for large files) on 11.2.0.4 and beyond.

    On older versions, first load the file into a (temporary) XMLType column with binary XML storage and CHOOSE from there.

    because I used dos2Unix to convert Unix which can be good or bad.

    This conversion should not be necessary.

Maybe you are looking for