purge data in Oracle tables

Team,

What are all the options database Oracle to cleaning a historical data data warehouse tables.

We intend to have a main table that will serve the period of 60 days, 90 days for each table

For example: more than 60 days in X table data will be purged.

It would be useful that I get some suggestions on this purge mechanism.

Thank you...

Partitioning (content) worth a visit if you have the Enterprise edition.

Tags: Database

Similar Questions

  • Import excel data in oracle tables

    Hello gurus,
    Importing excel data in oracle tables...

    I know it's the most common question on the wire... First, I searched the forum, I found lots of threads with loading data using sqlloader, excellent in conversion. Txt, file delimited by tabs, file .csv etc...

    Finally, I was totally confused in terms of how to get there...

    Here's wat I
       - Excel file on local computer.
       - i have laod data into dev environment tables(So no risk involved, but want to try something simple)
       - Oracle version 11.1.0.7
       - Sqlplus and toad (editors)
       
     
    Here's wat I want to do... .i don't know if its possible
        - Without going to unix server can i do everthing on local system by making use of oracle db and sqlplus or toad
       
    SQLLOADER could be an option... but I don't want to go the unix server to place files and newspapers and stuff.

    Wat will be the best option and the easiest to do? and wat format better convert excel csv or txt or tab delimited etc...


    If you suggest sqlloader, any example of code will be greatly appreciated.


    Thank you very much!!!

    Hello

    Toad version 9.0.0.160, you can directly load data excel file (or any other specified) to table using the navigation "database > import > import the data in the table.
    You need to connect to the database, then go to the above navigation. Select the table, validation interval (i.e. commit after each record or once all records), map columns in excel file to your table and press ok.
    It loads data directly to your table.

    But, if you use characters multibyte (such as Chinese) in excel file you want to load, then you must make some settings in your machine.

    Don't know if its possible in another version of Toad.

    Concerning
    Imran

  • Export data from Oracle table to a .csv file by putting a condition on the value of a column

    Hello gurus,

    I have the following data in my table

    ROWID name version date

    1 oracle 11.1 20/12/2013

    Java 2 7 12/10/2011

    1 oracle 12.1 28/12/2013

    1 oracle 10.2 12/06/2010

    Now I need a general sql/plsql code who wrote the columns with a specific value to the rowid.

    My output should look like

    1,Oracle,11.1,12/20/2013

    1,Oracle,12.1,12/28/2013

    1,Oracle,10.2,06/12/2010

    Here, I want to pass the value as a parameter dynamically

    Can someone help me with the sql/plsql.

    Hello

    If you use the IN operator:

    Select rowid_col

    || ',' || name_col

    || ',' || version_col

    || ',' || To_char (date_col, 'HH24:MI:SS of Mon-DD-YYYY') AS csv_text

    from your_table

    where rowid_col IN (& input_values);

    then & input_values can be a unique number (e.g. 1) or a list separated by commas (for example, 1,2,3) numbers.  Don't put NO space around the comma.

  • Load since excellent data to Oracle Tables

    Hi all

    I want to create a table with the payment year as default sysdate (to_char(sysdate,'yyyy')) and months in the form 'MM' (as default payment_month < (syadate, 'MM') >

    I'm doing it in vain. Help me please, and the other is want to load data from EXCEL to ORACLE table.

    I used to load the load data using SQL * LOADER. can you please let me know is possible to load data without using SQL * Loader? Please give me the solution for this.

    Thank you
    ORA.
  • Load huge data in oracle table

    Hello

    I am using oracle 11g Express Edition, I have formed a .csv file, which includes a 500MB size data that must be downloaded into the oracle table.

    Please suggest which would be the best method to load data into the table. Data are historical employee ticket, i.e. huge data.

    How to make download of mass data in the suggestion of experts need oracle table on this requirement.

    Thank you
    Sudhir

    best way SQL LOADER

  • problem loading data from oracle table excel table / oracle

    Hi all

    I'm working on the form of data transformation 2 different sources to a target table only oracle.
    My first source - excel sheet.
    2nd source - oracle table.

    Creation of data servers, dsn(for excel), reversing everything done very well.
    When I try to display the data there is a problem.

    EXCEL - serial number column is displayed as 1.0,2.0,.3.0 etc. need 1,2,3,4,5...
    Oracle tables-> after that reverse it does not display the data types for the selected columns.

    I am not able to create a join and run.
    Help, please.

    Thank you
    Chaitanya.

    Hello

    Just a thought, why not u cast TO_NUMBER to the interface mapping for the serial number column?

    Thank you
    Guru

  • Need help to load the data from the Excel data to oracle tables

    I need to load an Excel worksheet to the Oracle table.

    The worksheet contains 20 columns, the first 8 columns contains basic information, but the rest 12 columns contains info like
    1stQtr_08, 2ndQtr_08, 3rdQtr_08, 4thQtr_08
    1stQtr_09, 2ndQtr_09, 3rdQtr_09, 4thQtr_09
    1stQtr_10, 2ndQtr_10, 3rdQtr_10, 4thQtr_10

    So what I have to do is:

    break only one record (with 20 fields) in Excel to 3 files for each fiscal year in the Oracle table for each record in the database table will look like

    8 base field + fiscal_year + 1stQtr_08, 2ndQtr_08, 3rdQtr_08, 4thQtr_08
    8 base field + fiscal_year + 1stQtr_09, 2ndQtr_09, 3rdQtr_09, 4thQtr_09
    8 base field + fiscal_year + 1stQtr_10, 2ndQtr_10, 3rdQtr_10, 4thQtr_10

    There are about 10000 rows in the data file, so how can I use sqlldr to perform this task? beside sqlldr, other good suggestions?

    THX

    External tables is just an API Oracle sqlloader. If you are about to load this data over and over again, the external tables would be a good idea, but if it's a one time thing, sqlldir is more simple, unless you want to just learn to use external Tables.

    I used to run a data warehouse, so I did it, the less similar to what you do in the past.

  • Oracle PL SQL Question to get some data to oracle tables descrepancy

    Version of database

    Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64 bit Production
    PL/SQL Release 9.2.0.8.0 - Production
    CORE Production 9.2.0.8.0
    AMT for HP - UX: 9.2.0.8.0 - Production Version
    NLSRTL Version 9.2.0.8.0 - Production

    created a few sample data

    drop table tab1 purge;
    create table tab1 (DEPT_ID COMP, qc_subtype_id char (4), EQUIP_CODE varchar2 (20), create_time date);
    Insert into tab1 values(13,'1026','HEMORYA011',sysdate);
    Insert into tab1 values(13,'1012','HEMORYA011',sysdate);
    Insert into tab1 values(95,'1026','HEMORYA121',sysdate);
    Insert into tab1 values(95,'1012','HEMORYA121',sysdate);
    ----------------------
    Insert into tab1 values(13,'1026','HEMORYA014',sysdate);
    Insert into tab1 values(13,'1012','HEMORYA005',sysdate);
    Insert into tab1 values(13,'1012','HEMORYA013',sysdate);
    Insert into tab1 values(95,'1012','HEMORYA013',sysdate);
    Insert into tab1 values(95,'1012','HEMORYA148',sysdate);

    commit;

    I need to get a query to get the records of the gap

    Dept HEMORYA014 13 lack 1012

    HEMORYA005 dept 12 lack 1026

    Dept HEMORYA013 13 lack 1026

    The dept 95 lack 1026 HEMORYA013

    The dept 95 lack 1026 HEMORYA148

    I want to show the latter on the report

    Thanks in advance.

    Thanks for posting a unit test.
    I hope it will work for you, but maybe you will need to set the WHERE clause (add additional predicates).

    SQL> select equip_code
      2  from ( select equip_code
      3         ,      count(distinct qc_subtype_id)
      4         from   tab1
      5         group by equip_code
      6         having count(distinct qc_subtype_id)<2
      7        )
      8  order by equip_code;
    
    EQUIP_CODE
    --------------------
    HEMORYA005
    HEMORYA013
    HEMORYA014
    HEMORYA148
    
  • How to load data from Oracle tables into essbase?


    Hello

    I'm fairly new to essbase. We are working on essbase 11.1.2.2.

    I want to build size & load data using pre-existing data warehouse which is built on Oracle.

    I try to use "Open SQL". I use OIC.  It is gicing me connection error (1021001).

    The following log shows:

    [Sea 14 Aug 14:15:06 2013] Local/SA_EB_1/MIS_FIN/SA0053580@Native Directory/10868/Info (1021097)
    EssOCI Initializes the connection to the Oracle database on the server [tmdwtst1]

    [Sea 14 Aug 14:15:25 2013] Local/SA_EB_1/MIS_FIN/SA0053580@Native Directory/10868/Info (1021099)
    EssOCI could not connect to the Oracle database with error message [ORA-12154: TNS: could not resolve the connect identifier specified]
    ]

    [Sea 14 Aug 14:15:25 2013] Local/SA_EB_1/MIS_FIN/SA0053580@Native Directory/10868/Error (1021001)
    Cannot establish a connection to the SQL database server.  See the log for more information

    [Sea 14 Aug 14:15:25 2013] Local/SA_EB_1/MIS_FIN/SA0053580@Native Directory/10868/Warning (1080014)
    Transaction [0 x 2650001 (0x520b4392.0x69b68)] abandoned due to the State [1021001].

    Help, please.

    Thank you

    Sam

    You use the correct format for the OIC:

    Host: port / Oracle_service_name

    See you soon

    John

    http://John-Goodwin.blogspot.com/

  • Load xml data into an Oracle table

    Hello

    I went through some threads in the forums itself, but for my requirement that nothing comes closer, I write my request. I have a XML like this
    <? XML version = "1.0"? >
    < ACCOUNT_HEADER_ACK >
    < HEADER >
    < STATUS_CODE > 100 < / STATUS_CODE >
    Check < STATUS_REMARKS > < / STATUS_REMARKS >
    < / Header >
    < DETAILS >
    < DETAIL >
    < SEGMENT_NUMBER > 2 < / SEGMENT_NUMBER >
    PR Polytechnic < REMARKS > < / COMMENTS >
    < / DETAILS >
    < DETAIL >
    < SEGMENT_NUMBER > 3 < / SEGMENT_NUMBER >
    < REMARKS > PR Polytechnic administration < / COMMENTS >
    < / DETAILS >
    < DETAIL >
    < SEGMENT_NUMBER > 4 < / SEGMENT_NUMBER >
    < REMARKS > rp Polytechnique finance < / COMMENTS >
    < / DETAILS >
    < DETAIL >
    < SEGMENT_NUMBER > 5 < / SEGMENT_NUMBER >
    < REMARKS > logistics Polytechnique rp < / COMMENTS >
    < / DETAILS >
    < / DETAILS >
    < HEADER >
    < STATUS_CODE > 500 < / STATUS_CODE >
    < STATUS_REMARKS > process exception < / STATUS_REMARKS >
    < / Header >
    < DETAILS >
    < DETAIL >
    < SEGMENT_NUMBER > 20 < / SEGMENT_NUMBER >
    Basic Polytechnique < REMARKS > < / COMMENTS >
    < / DETAILS >
    < DETAIL >
    < SEGMENT_NUMBER > 30 < / SEGMENT_NUMBER >
    < / DETAILS >
    < DETAIL >
    < SEGMENT_NUMBER > 40 < / SEGMENT_NUMBER >
    Finance basic Polytechnique < REMARKS > < / COMMENTS >
    < / DETAILS >
    < DETAIL >
    < SEGMENT_NUMBER > 50 < / SEGMENT_NUMBER >
    Logistics base Polytechnique < REMARKS > < / COMMENTS >
    < / DETAILS >
    < / DETAILS >
    < / ACCOUNT_HEADER_ACK >

    Here is the xml structure of the master structure and child I want to insert data in Oracle tables using the sql * loader initially tried to create a control file, but I don't know how to terminate in the control file, so I created two control files

    load data
    INFILE 'acct.xml' ' str ' < / DETAIL >»»
    TRUNCATE
    in the xxrp_acct_detail table
    TRAILING NULLCOLS
    (
    dummy fill finished by "< DETAIL >."
    SEGMENT_NUMBER surrounded by '< SEGMENT_NUMBER >' and ' < / SEGMENT_NUMBER >, "
    REMARKS framed by 'Of REMARKS <>' and ' < / COMMENTS >.
    )


    load data
    ACCT.XML INFILE' "str" < / header > ' "»
    TRUNCATE
    in the xxrp_acct_header table
    fields terminated by '< HEADER >.
    TRAILING NULLCOLS
    (
    dummy fill finished by "< HEADER >."
    STATUS_CODE framed by '< STATUS_CODE >' and ' < / STATUS_CODE >. "
    STATUS_REMARKS surrounded by '< STATUS_REMARKS >' and ' < / STATUS_REMARKS >.
    )

    I refer to the same xml file in two control files, where with regard to the first control file, I was able to load the files but the second which I suppose as table header not able to load the records of rest. I get the below error.

    Sheet 2: Rejected - error on the XXRP_ACCT_HEADER, column DUMMY table.
    Field in the data file exceeds the maximum length
    Sheet 3: Rejected - error on the XXRP_ACCT_HEADER, column DUMMY table.
    Field in the data file exceeds the maximum length

    In fact if its possible to seggrate a control file so it will be very useful for me. I'm also open for the external table as option. Please help me in this regard.

    Thanks in advance.

    Concerning
    Mr. Nagendra

    Here are two possible solutions:

    (1) reading the headers and separate details using two XMLTables:

    DECLARE
    
     acct_doc xmltype := xmltype( bfilename('TEST_DIR','acct.xml'), nls_charset_id('AL32UTF8') );
    
    BEGIN
    
     insert into xxrp_acct_details (status_code, status_remarks, segment_number, remarks)
     select x1.status_code,
            x1.status_remarks,
            x2.segment_number,
            x2.remarks
     from xmltable(
      '/ACCOUNT_HEADER_ACK/HEADER'
      passing acct_doc
      columns header_no      for ordinality,
              status_code    number        path 'STATUS_CODE',
              status_remarks varchar2(100) path 'STATUS_REMARKS'
     ) x1,
     xmltable(
      '$d/ACCOUNT_HEADER_ACK/DETAILS[$hn]/DETAIL'
      passing acct_doc as "d",
              x1.header_no as "hn"
      columns segment_number number        path 'SEGMENT_NUMBER',
              remarks        varchar2(100) path 'REMARKS'
     ) x2
     ;
    
    END;
    

    All first (alias X 1) retrieves all headers in separate lines. The HEADER_NO generated column is used to keep track of the position of the header into the document.
    Then, we join a second XMLTable (X 2), passing HEADER_NO, so that we can access the corresponding items in DETAIL.

    (2) reading with one XMLTable, but somewhat more complex XQuery:

    DECLARE
    
     acct_doc xmltype := xmltype( bfilename('TEST_DIR','acct.xml'), nls_charset_id('AL32UTF8') );
    
    BEGIN
    
     insert into xxrp_acct_details (status_code, status_remarks, segment_number, remarks)
     select x.*
     from xmltable(
      'for $i in /ACCOUNT_HEADER_ACK/HEADER
       return
        for $j in $i/following-sibling::DETAILS[1]/DETAIL
        return element r {$i, $j}'
      passing acct_doc
      columns status_code    number        path 'HEADER/STATUS_CODE',
              status_remarks varchar2(100) path 'HEADER/STATUS_REMARKS',
              segment_number number        path 'DETAIL/SEGMENT_NUMBER',
              remarks        varchar2(100) path 'DETAIL/REMARKS'
     ) x
     ;
    
    END;
    

    Here, we use an XQuery query to extract the information that we need.
    Basically it's the same logic as above, but with two nested loops which access each header, then each RETAIL location immediately after in the order of the documents.

    Here is the link to the documentation XMLTable and XQuery in Oracle:
    http://download.Oracle.com/docs/CD/B28359_01/AppDev.111/b28369/xdb_xquery.htm#CBAGCBGJ

  • Is it possible to record the interview in cloud Service Oracle table data before submitting

    Hello

    We use customer portal application and would like to save data in Oracle Service cloud tables between interview, before submitting.

    Y at - it an option to save the data?

    the cloud of 12.2 current supports, pre loading data and submitted data. Please help on this.

    Thank you

    Vivek

    Thanks for the inputs.

    We strive to implement save button and button Save & continue on each page, because we have many issues to be resolved.

    In our scenario, a folder must be created for all the session data.

    Thank you
    Vivek

  • Load table data into Oracle Essbase

    Hi all

    I have a problem

    1 oracle table have 50 million records

    Essbase load data from that

    ODI error message:

    Caused by: java.sql.BatchUpdateException: means: Java heap space

    at org.hsqldb.jdbc.JDBCPreparedStatement.executeBatch (unknown Source)

    at oracle.odi.runtime.agent.execution.sql.BatchSQLCommand.execute(BatchSQLCommand.java:44)

    at oracle.odi.runtime.agent.execution.sql.SQLExecutor.execute(SQLExecutor.java:102)

    at oracle.odi.runtime.agent.execution.sql.SQLExecutor.execute(SQLExecutor.java:1)

    at oracle.odi.runtime.agent.execution.DataMovementTaskExecutionHandler.handleTask(DataMovementTaskExecutionHandler.java:87)

    at com.sunopsis.dwg.dbobj.SnpSessTaskSql.processTask(SnpSessTaskSql.java:2913)

    at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java:2625)

    at com.sunopsis.dwg.dbobj.SnpSessStep.treatAttachedTasks(SnpSessStep.java:577)

    at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java:468)

    at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java:2128)

    to oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$ 2.doAction(StartSessRequestProcessor.java:366)

    at oracle.odi.core.persistence.dwgobject.DwgObjectTemplate.execute(DwgObjectTemplate.java:216)

    at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.doProcessStartSessTask(StartSessRequestProcessor.java:300)

    to oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.access$ 0 (StartSessRequestProcessor.java:292)

    to oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$ StartSessTask.doExecute (StartSessRequestProcessor.java:855)

    at oracle.odi.runtime.agent.processor.task.AgentTask.execute(AgentTask.java:126)

    to oracle.odi.runtime.agent.support.DefaultAgentTaskExecutor$ 2.run(DefaultAgentTaskExecutor.java:82)

    at java.lang.Thread.run(Thread.java:662)

    I think that Agent Load data so great, if memory cannot load.

    How to fix?

    Please give me a solution.

    Thank you

    As Craig said, move the staging area out the SUNOPSIS MEMORY ENGINE initially. This should only be considered if you are mobile / transform small amounts of data (including 50 million lines isn't :-)).) Why you do not set the staging on your Source Oracle DB in this way, you remove an unnecessary data movement i.e. the LKM and don't rely on memory in engine.

  • Need help for query flat_file type clobdata oracle table data.

    Hi Sir,

    I need help to query oracle table flat file data having given clob type.
    Oracle Version:
    
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product
    PL/SQL Release 10.2.0.1.0 - Production
    "CORE     10.2.0.1.0     Production"
    TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    
    
    
    Source table
    
      CREATE TABLE order_details 
       (     QUEUE_SEQNUM NUMBER(10,0) NOT NULL ENABLE, 
         LINE_SEQNUM NUMBER(10,0) NOT NULL ENABLE, 
         CHAR_DATA CLOB, 
         OPTIMISTIC_LOCK_KEY NUMBER(20,0)
       ) 
    COLUMN FOR CHAR_DATA FLAT_FILE
    EU,6067AT,AT10,000000402004,NexiumGERDManagementProject,Z435,,ZZ29,NIS-GOLD,AT
    EU,6067AT,AT10,000000402038,NIS-OEU-ARI-2007/1,Z450,,ZZ29,NIS-OEU-ARI-2007/1,AT
    EU,6067AT,AT10,000000402039,SymbicortNISinCOPD,Z450,,ZZ29,NIS-REU-DUM-2007/1,AT
    EU,6067AT,AT10,000000402040,D1443L00044SeroquelXRRuby,Z450,,ZZ29,D1443L00044,AT
    EU,6067AT,AT10,000000402041,NIS-GEU-DUM-2008/1,Z450,,ZZ29,NIS-GEU-DUM-2008/1,AT
    EU,6067AT,AT10,000000402042,SonstigeAktivitätenLCM,Z450,,ZZ29,.,AT
    EU,6067AT,AT10,000000402134,D1680L00002Saxagliptin,Z450,,ZZ29,D1680L00002,AT
    EU,6067AT,AT10,000000402199,SeroquelWaveNIS,Z450,,ZZ29,NIS-NEU-DUM-2009/1,AT
    EU,6067AT,AT10,000000402313,SeroquelExtra(D1443L00082),Z450,,ZZ29,D1443L00082,AT
    EU,6067AT,AT10,000000402517,AtlanticD5130L00006(AZD6140),Z450,,ZZ29,D5130L00006,AT
    EU,6067AT,AT10,000000554494,ArimidexSt.Gallen(13+2),Z142,,ZZ09,,AT
    EU,6067AT,AT10,000000554495,ArimidexASCO(5delegates),Z142,,ZZ09,,AT
    EU,6067AT,AT10,000000554496,ArimidexSanAntonio6delegates,Z142,,ZZ09,,AT
    EU,6067AT,AT10,000000554497,ArimidexBreastCancerSummit(13+2),Z130,,ZZ09,,AT
    EU,6067AT,AT10,000000554498,ArimidexEIH(15delegates),Z130,,ZZ09,,AT
    EU,6067AT,AT10,000000554499,ArimidexNIFA(200delegates),Z135,,ZZ09,,AT
    EU,6067AT,AT10,000000554500,ArimidexNIFAworkshops(8x25),Z135,,ZZ09,,AT
    EU,6067AT,AT10,000000554501,ArimidexPraktischeGyn.Fortbildung,Z147,,ZZ09,,AT
    EU,6067AT,AT10,000000554502,ArimidexAGO,Z147,,ZZ09,,AT
    EU,6067AT,AT10,000000554503,ArimidexHämato/OnkologieKongress,Z147,,ZZ09,,AT
    EU,6067AT,AT10,000000554504,ARIMIDEXGYNäKOLOGENKONGRESS,Z147,,ZZ09,,AT
    EU,6067AT,AT10,000000554505,ArimidexChirurgenkongress,Z147,,ZZ09,,AT
    EXPECTED RESULTS:
    AFFIRM_CODE COMPANY_CODE INTERNAL_ORDER_CODE INTERNAL_ORDER_DESC ENIGMA_ACTIVITY             SUB_ACTIVITY_CODE IN_AFF_IND ORDER_TYPE EXTERNAL_ORDER COUNTRY        
    EU          6067AT       AT10                 000000402004       NEXIUMGERDMANAGEMENTPROJECT     Z435           NULL        ZZ29       NIS-GOLD        AT             
    EU          6068AT       AT11                 000000402005       NEXIUMGERDMANAGEMENTPROJECT     Z435           NULL        ZZ29       NIS-GOLD        AT             

    Sorry, my bad. Without database at hand, I'll try 'baby steps' (borrowed from Frank) so you don't confuse it with errors that I might add (happens far too often already, but at least you won't "swallow" as forum members think is one of the main goals of this fighter - help her learn - providing not only the proverbial fish.)
    Search the Forum - your problem is one of its best sellers. Watching {message identifier: = 10694602} ("split string into" was the key word used in research) you can try something as

    select table_row,
           level clob_row,
           regexp_substr(char_data,'[^' || chr(13) || chr(10) || ']+',1,level) the_line
      from (select to_char(queue_seqnum)||':'||to_char(line_seqnum) table_row,
                   char_data
              from order_details
           )
     connect by regexp_substr(char_data,'[^' || chr(13) || chr(10) || ']+',1,level) is not null
            and prior char_data = char_data
            and prior table_row = table_row
            and prior sys_guid() is not null
    

    to get all the s the_lineall CLOB and after that the use of the example even to get your columns of each the_line.

    Concerning

    Etbin

    Edited by: Etbin on 3.2.2013 09:01

    .. .but I m connected to do things according to the instructions, I can't do something.

    Used to happen to me too and I did as told to the but only after explaining any disadvantages, I was aware of in time. The last sentence is usually: "O.K. now be just and Don't come back with that kind of thing when it turns out that this isn't the right thing."
    rp0428 post - something to remember.

  • Insert data as XML into the Oracle Table

    Hi all

    I have a requirement where the data in XML format, and I need to insert into the Oracle Table. For example, I get XML data in the following format,
    < results >
    < row >
    < BANK_ACCOUNT_ID > 10010 < / BANK_ACCOUNT_ID >
    < BANK_ID > 300968 < / BANK_ID >
    Vision operations < LEGAL_ENTITY > < / LEGAL_ENTITY >
    < BANK_NAME > BofA < / BANK_NAME >
    < BANK_ACCOUNT_NUM > 10271-17621-619 < / BANK_ACCOUNT_NUM >
    < BANK_ACCOUNT_NAME > BofA-204 < / BANK_ACCOUNT_NAME >
    < BRANCH_NAME > New York < / BRANCH_NAME >
    USD < CURRENCY_CODE > < / CURRENCY_CODE >
    < BALANCE_DATE > 2007 - 11 - 09 < / BALANCE_DATE >
    < LEDGER_BALANCE > 432705900.56 < / LEDGER_BALANCE >
    < / row >
    < row >
    < BANK_ACCOUNT_ID > 10091 < / BANK_ACCOUNT_ID >
    < BANK_ID > 300984 < / BANK_ID >
    Vision industries < LEGAL_ENTITY > < / LEGAL_ENTITY >
    Barclay Bank < BANK_NAME > < / BANK_NAME >
    < BANK_ACCOUNT_NUM > 70986798 < / BANK_ACCOUNT_NUM >
    Bank Multi currency-626 < BANK_ACCOUNT_NAME > Barclays < / BANK_ACCOUNT_NAME >
    Reading < BRANCH_NAME > < / BRANCH_NAME >
    GBP < CURRENCY_CODE > < / CURRENCY_CODE >
    < BALANCE_DATE > 2007 - 11 - 14 < / BALANCE_DATE >
    < LEDGER_BALANCE > 24244085.24 < / LEDGER_BALANCE >
    < / row >
    < row >
    < BANK_ACCOUNT_ID > 10127 < / BANK_ACCOUNT_ID >
    < BANK_ID > 300968 < / BANK_ID >
    < LEGAL_ENTITY > SSC U.S. 01 < / LEGAL_ENTITY >
    < BANK_NAME > BofA < / BANK_NAME >
    < BANK_ACCOUNT_NUM > 4898744 < / BANK_ACCOUNT_NUM >
    < BANK_ACCOUNT_NAME > BofA SSC U.S. 02-7188 < / BANK_ACCOUNT_NAME >
    < BRANCH_NAME > New York < / BRANCH_NAME >
    USD < CURRENCY_CODE > < / CURRENCY_CODE >
    < BALANCE_DATE > 2007 - 11 - 28 < / BALANCE_DATE >
    < LEDGER_BALANCE > 10783815.28 < / LEDGER_BALANCE >
    < / row >
    < / results >

    I like to write PLSQL code that will receive these data with XML tags and insert it into the Oracle Table. Is this possible with built-in XML features provided in the Oracle database?

    Please Guide...

    Kind regards
    Priyanka

    But the problem is the file XML is to have the details of the records if you carefully observed the XML file. But by using more high statement select I get output in the following format.
    ORG_ID REQ_LINE PO_NUMBER EXPECTED_REC_QTY USER_NAME REQ_NUMBER
    204204 1444714450 11 64446445 11 OPERATIONSOPERATIONS

    The table has only one row, so you get a single row as output.
    I'm surprised that you find useful examples showing how to divide the data into several lines.

    (1) create the table with the following option, it will optimize the performance of storage and query for large XML documents:

    CREATE TABLE xxios_xml_data_test(xml_data XMLTYPE)
    XMLTYPE COLUMN xml_data STORE AS SECUREFILE BINARY XML
    ;
    

    (2) interview table with:

    SQL> select x.*
      2  from xxios_xml_data_test t
      3     , xmltable(
      4         '/Results/Row'
      5         passing t.xml_data
      6         columns ORG_ID           number       path 'ORG_ID'
      7               , REQ_NUMBER       number       path 'REQ_NUMBER'
      8               , REQ_LINE         number       path 'REQ_LINE'
      9               , PO_NUMBER        number       path 'PO_NUMBER'
     10               , EXPECTED_REC_QTY number       path 'EXPECTED_REC_QTY'
     11               , USER_NAME        varchar2(30) path 'USER_NAME'
     12       ) x
     13  ;
    
        ORG_ID REQ_NUMBER   REQ_LINE  PO_NUMBER EXPECTED_REC_QTY USER_NAME
    ---------- ---------- ---------- ---------- ---------------- ------------------------------
           204      14447          1       6444                1 OPERATIONS
           204      14450          1       6445                1 OPERATIONS
     
    
  • Formate LKM support of Oracle (TABLE EXTRENAL) data LENGTH FIXED files?

    Hi all

    I'm working on a simple test to create an external table using the "LKM to Oracle (TABLE EXTRENAL)" file to load a data file of fixed length (no separator/delimiter). After running, the error is as follows:

    2009-11-23 07:26:02 PM (DwgCmdExecutionThread): SnpSessTask.treatSqlException: 29913: 99999: java.sql.SQLException: 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 'colon': expected an of: "asterisk, number.
    KUP-01007: in the column of the row 12 28

    java.sql.SQLException: 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 'colon': expected an of: "asterisk, number.
    KUP-01007: in the column of the row 12 28


    The external table creation code generated is:

    «"createTblCmd = r»»»
    create the table ODI_WORK_SCHEMA. C$ _0PARTIAL_SHPT_TMP
    (
    C1_RECORD_TYPE VARCHAR2 (2),
    C2_ISN VARCHAR2 (8).
    C3_AWB_UID VARCHAR2 (11),
    C4_FLIGHT_ID VARCHAR2 (7).
    C5_FLIGHT_DATE VARCHAR2 (8).
    C6_AIRCRAFT_FLOW_TYPE VARCHAR2 (1).
    C7_PORT_CODE VARCHAR2 (3),
    C8_SHPT_BD_PIECES VARCHAR2 (5).
    C9_SHPT_BD_WEIGHT VARCHAR2 (9).
    C10_SHPT_MAN_PIECES VARCHAR2 (5).
    C11_SHPT_MAN_WEIGHT VARCHAR2 (9).
    C12_SHPT_MAN_VOLUME VARCHAR2 (12)
    )
    EXTERNAL ORGANIZATION
    (
    TYPE ORACLE_LOADER
    Dat_dir default DIRECTORY
    ACCESS SETTINGS
    (
    RECORDS DELIMITED BY 0 x '0D0A '.
    CHARACTERSET "WE8ISO8859P1".
    STRING SIZES ARE IN CHARACTERS
    BADFILE "PARTIAL_SHPT_FIXED_NHF.dat_%a.bad."
    LOGFILE "PARTIAL_SHPT_FIXED_NHF.dat_%a.log".
    DISCARDFILE 'PARTIAL_SHPT_FIXED_NHF.dat_%a.dsc '.
    SKIP 0

    FIELDS
    MISSING FIELD VALUES ARE NULL
    (
    C1_RECORD_TYPE POSITION (:),
    C2_ISN POSITION (:),
    C3_AWB_UID POSITION (:),
    C4_FLIGHT_ID POSITION (:),
    C5_FLIGHT_DATE POSITION (:),
    C6_AIRCRAFT_FLOW_TYPE POSITION (:),
    C7_PORT_CODE POSITION (:),
    C8_SHPT_BD_PIECES POSITION (:),
    C9_SHPT_BD_WEIGHT POSITION (:),
    C10_SHPT_MAN_PIECES POSITION (:),
    C11_SHPT_MAN_WEIGHT POSITION (:),
    C12_SHPT_MAN_VOLUME POSITION (:)
    )
    )
    LOCATION ("PARTIAL_SHPT_FIXED_NHF.dat")
    )
    PARALLEL
    REJECT LIMIT UNLIMITED
    """

    # Create the statement
    mystmt = myCon.createStatement)

    # Run the trigger creation
    myStmt.execute (createTblCmd)

    myStmt.close)
    mystmt = None

    # Commit, just in case
    myCon.commit)

    1. How can I solve this problem?
    2. If my data file have no record separator and the field delimiter, how do I configure in sub ODI?

    Remarks:

    1. the format of file under the "files" is "fixed".


    Thank you very much!!

    Tao

    Tao,

    Your problem is not LKM(External Table). You will need to set the interface diagram. Select each column in the pane "DataStore target" of the "Diagram" tab when you open the interface.
    Mark "run" for each column to be on the "staging area".
    Currently, you have all the columns marked in 'Source '.

    This will fix the problem.

    Hope that helps.
    PS Don't forget to mark as good/useful solutions if you feel they were.

Maybe you are looking for