Moving Data from Normal table to History tables

Hi All,
I'm in the process of moving data from normal tables to
History tables.
It can be some sort of a procedure which should be a cron job running at night.
My aim is to move data say 1.5 yrs or 2yrs old data to History tables.
What aspects i need to check when moving data. And how can i write a procedure for this requirement.
The schema is same in both the normal table and history table.
It has to be a procedure based on particular field RCRE_DT.
If the rcre_dt is above 2 yrs the data needs to be moved to HIS_<table>.
I have to insert record in to HIS_table and simultaneously delete record from the normal table.
This is in Production system and the tables are quite big.
Pls do find enclosed the attached sample schema for Normal table and HIS_<table>.
If i want to automate this script as a Cron job for similarly other History tables
how am i to do it in a single procedure assuming the procedure for moving the data is the same procedure.
Thanks for ur help in advance.
SQL> DESC PXM_FLT;
Name Null? Type
RCRE_USER_ID NOT NULL VARCHAR2(15)
RCRE_DT NOT NULL DATE
LCHG_USER_ID VARCHAR2(15)
LCHG_DT DATE
AIRLINE_CD NOT NULL VARCHAR2(5)
REF_ID NOT NULL VARCHAR2(12)
BATCH_DT NOT NULL DATE
CPY_NO NOT NULL NUMBER(2)
ACCRUAL_STATUS NOT NULL VARCHAR2(1)
FLT_DT NOT NULL DATE
OPERATING_CARRIER_CD NOT NULL VARCHAR2(3)
OPERATING_FLT_NO NOT NULL NUMBER(4)
MKTING_CARRIER_CD VARCHAR2(3)
MKTING_FLT_NO NUMBER(4)
BOARD_PT NOT NULL VARCHAR2(5)
OFF_PT NOT NULL VARCHAR2(5)
AIR_CD_SHARE_IND VARCHAR2(1)
UPLOAD_ERR_CD VARCHAR2(5)
MID_PT1 VARCHAR2(5)
MID_PT2 VARCHAR2(5)
MID_PT3 VARCHAR2(5)
MID_PT4 VARCHAR2(5)
MID_PT5 VARCHAR2(5)
PAX_TYPE VARCHAR2(3)
PAY_PRINCIPLE VARCHAR2(1)
SQL> DESC HIS_PXM_FLT;
Name Null? Type
RCRE_USER_ID NOT NULL VARCHAR2(15)
RCRE_DT NOT NULL DATE
LCHG_USER_ID VARCHAR2(15)
LCHG_DT DATE
AIRLINE_CD NOT NULL VARCHAR2(5)
REF_ID NOT NULL VARCHAR2(12)
BATCH_DT NOT NULL DATE
CPY_NO NOT NULL NUMBER(2)
ACCRUAL_STATUS NOT NULL VARCHAR2(1)
FLT_DT NOT NULL DATE
OPERATING_CARRIER_CD NOT NULL VARCHAR2(3)
OPERATING_FLT_NO NOT NULL NUMBER(4)
MKTING_CARRIER_CD VARCHAR2(3)
MKTING_FLT_NO NUMBER(4)
BOARD_PT NOT NULL VARCHAR2(5)
OFF_PT NOT NULL VARCHAR2(5)
AIR_CD_SHARE_IND VARCHAR2(1)
UPLOAD_ERR_CD VARCHAR2(5)
MID_PT1 VARCHAR2(5)
MID_PT2 VARCHAR2(5)
MID_PT3 VARCHAR2(5)
MID_PT4 VARCHAR2(5)
MID_PT5 VARCHAR2(5)
PAX_TYPE VARCHAR2(3)
PAY_PRINCIPLE VARCHAR2(1)

Hi All,
Thanks for ur valuable suggestion.But can u explain me bit more on this as i'm still confused about switching between partitoned tables and temporary table.Suppose if i have a table called PXM_FLT and an correspoding similar table named HIS_PXM_FLT.How can i do the partitioning shd i do the partitioning on the normal table or HIS_PXM_FLT.i do have a date field for me to partition based on range.Can u pls explain why shd i again create a temp.table.What's the purpose.Now the application is designed in such a way that old records have to be moved to HIS_PXM_FLT.can u pls highlight more on this.Your suggestions are greatly appreciated.As i'm relatively new to this partitioning technique i'm bit confused on how it works.But i came to understand Partitioning is a better operation than the normal insert or delte as it is more data intensive as millions of record need to be moved.Thanks for feedback and ur precious time.

Similar Messages

  • Moving data from custom fields to ekko table

    Hi Experts,
    I added new custom tab into me21n,me22n,me23n header thro me_gui_po_cust and me_process_po_cust.
    If i enter values in my custom fields, transport_from_model this method is not triggering.i have written below code in this method.
    METHOD if_ex_me_gui_po_cust~transport_from_model.
      DATA:     l_header  TYPE REF TO if_purchase_order_mm,
                ls_mepoheader  TYPE mepoheader,
                ls_customer TYPE ci_ekkodb.
      CASE im_name.
        WHEN subscreen.
          mmpur_dynamic_cast l_header im_model.
          CHECK NOT l_header IS INITIAL.
          ls_mepoheader = l_header->get_data( ).
          CALL FUNCTION 'ZMM_GET_DATA'
            EXPORTING
              im_ebeln       = ls_mepoheader-ebeln
    *            im_ebelp       = ls_mepoheader-ebelp
           IMPORTING
             ex_data        = ls_customer .
          MOVE-CORRESPONDING ls_mepoheader TO dynp_data_pbo.
          MOVE ls_customer-ztender TO dynp_data_pbo-ztender.
          MOVE ls_customer-zemdapplicable TO dynp_data_pbo-zemdapplicable.
          MOVE ls_customer-zpbgapplicable TO dynp_data_pbo-zpbgapplicable.
          MOVE ls_customer-zemdamount TO dynp_data_pbo-zemdamount.
          MOVE ls_customer-zemdvalidity TO dynp_data_pbo-zemdvalidity.
        WHEN OTHERS.
      ENDCASE.
    ENDMETHOD.
    i cant move my values entered in custom fields to ekko table.
    please help if u know..
    regards,
    Kavitha
    Edited by: Matt on Mar 23, 2011 10:55 AM added  tags

    Hi,
    check this out.. !!
    Import data from Excel to Oracle Database and
    Added link From Ask Tom.. your requirement you would be satisfied.. I supppose.. !!
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:908428873069
    - Pavan Kumar N

  • Moving data from .xls spreadsheet to database table

    Hi,
    Does any one know a script or the procedure to move data from an .xls spreadsheet to a database table?
    Thanks,
    Ranjana

    Hi,
    check this out.. !!
    Import data from Excel to Oracle Database and
    Added link From Ask Tom.. your requirement you would be satisfied.. I supppose.. !!
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:908428873069
    - Pavan Kumar N

  • Moving data from flat file

    Hi,
    I am moving data from flat file to oracle table. while populating the oracle table if I get any errors in flat file those errors should populate in ODI error table.
    Is this is possible? if yes. Could you please let me know the set up in ODI.

    CKM is the dedicated for checking the constraints while doing transformation. The constraints includes, PK,FK, conditions etc.,
    There are two types/ways of checking the constraints.
    Flow Control: Triggered CKM after data is loaded in to I$.
    Static Control : Triggered CKM after data is loaded in to target table.
    If you opt for any one the above ODI will create E$ and SNP_CHECK_TAB (summary table for logging the errors) and load the error records.
    ODI will also provide you an option of loading the corrected error records by RECYCLE ERROR feature. In this phase/run ODI will load ONLY the error records in to target table (assuming its been corrected/cleaned).
    **how to set up flow control could you please provide steps**
    **Appreciate your help**

  • How to load the data from .csv file to oracle table???

    Hi,
    I am using oracle 10g , plsql developer. Can anyone help me in how to load the data from .csv file to oracle table. The table is already created with the required columns. The .csv file is having about 10lakh records. Is it possible to load 10lakh records. can any one please tell me how to proceed.
    Thanks in advance

    981145 wrote:
    Can you tell more about sql * loader??? how to know that utility is available for me or not??? I am using oracle 10g database and plsql developer???SQL*Loader is part of the Oracle client. If you have a developer installation you should normally have it on your client.
    the command is
    sqlldrType it and see if you have it installed.
    Have a look also at the FAQ link posted by Marwin.
    There are plenty of examples also on the web.
    Regards.
    Al

  • Upload data from excel file to Oracle table

    Dear All,
    I have to upload data from excel file to Oracle table without using third party tools and without converting into CSV file.
    Could you tell me please how can i do this using PLSQl or SQL Loader.
    Thnaks in Advance..

    Dear All,
    I have to upload data from excel file to
    Oracle table without using third party tools and
    without converting into CSV file.
    Could you tell me please how can i do this
    using PLSQl or SQL Loader.
    Thnaks in Advance..As billy mentioned using ODBC interface ,the same HS service which is a layer over using traditional ODBC to access non oracle database.Here is link you can hit and trial and come out here if you have any problem.
    http://www.oracle-base.com/articles/9i/HSGenericConnectivity9i.php[pre]
    Khurram                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Display Data from multiple models in one table

    Hi Experts,
    Is it possible to display data from multiple models in one table smltnsly.
    I have created a table dynamically.Now I would like to display data from multiple models... If this possible,can anyone give me a lead as to how to do it..
    Regards
    SU

    Hi
    Your Model Nodes be
    Model1
    ---Output_Model1
    Attrib1
    Attrib2
    Model2
    ---Output_model2
    Attrib1
    Attrib2
    and the value node is
    ValueNode
    ---Attrib1
    ---Attrib2
    Now the coding.
    int size;
    IPrivate<ViewName>.IOutput_mode1Node  node1 = wdContext.nodeOuptut_Model1();
    IPrivate<ViewName>.IValueNodeElement elem;
    size = node1.size();
    for(int i=0; i<size; i++)
       elem = wdContext.createValueNodeElement();
       elem.setAttrib1( node1.getOutput_Model1ElementAt(i).getAttrib1() );
       elem.setAttrib2( node1.getOutput_Model1ElementAt(i).getAttrib2();
       wdContext.nodeValueNode().addElement( elem );
    similar code for Model Node 2
    Regards
    Abhimanyu L

  • How to get the data from multiple nodes to one table

    Hi All,
    How to get the data from multiple nodes to one table.examples nodes are like  A B C D E relation also maintained
    Regards,
    Indra

    HI Indra,
    From Node A, get the values of the attributes as
    lo_NodeA->GET_STATIC_ATTRIBUTES(  IMPORTING STATIC_ATTRIBUTES = ls_attributesA  ).
    Similarily get all the node values from B, C, D and E.
    Finally append all your ls records to the table.
    Hope you are clear.
    BR,
    RAM.

  • How to get the data from pcl2 cluster for TCRT table.

    Hi frndz,
    How to get the data from pcl2 cluster for tcrt table for us payroll.
    Thanks in advance.
    Harisumanth.Ch

    PL take a look at the sample Program EXAMPLE_PNP_GET_PAYROLL in your system. There are numerous other ways to read payroll results.. Pl use the search forum option & you sure will get a lot of hits..
    ~Suresh

  • Loading data from .csv file into Oracle Table

    Hi,
    I have a requirement where I need to populate data from .csv file into oracle table.
    Is there any mechanism so that i can follow the same?
    Any help will be fruitful.
    Thanks and regards

    You can use Sql Loader or External tables for your requirement
    Missed Karthick's post ...alredy there :)
    Edited by: Rajneesh Kumar on Dec 4, 2008 10:54 AM

  • How to create a form which has browse option ? Then how to upload the data from the excel file to table in Oracle DB?

    Hi Everyone,
    I am new to Oracle forms. I have a requirement where user wants a form which can be used to browse a excel file from his/her system. Also after browsing the file the user should be able to load the data from the file to a table in the Oracle DB.
    Any help pointers would be appreciated.
    Thanks,
    Satya
    Message was edited by: user12098633

    Hi Marcus,
    I am using EBS (E- Business Suite) ERP and version is 11.5.10.2
    My database version is as below
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    PL/SQL Release 11.2.0.3.0 - Production
    CORE
    11.2.0.3.0
    Production
    TNS for IBM/AIX RISC System/6000: Version 11.2.0.3.0 - Production
    NLSRTL Version 11.2.0.3.0 - Production
    I want to move csv file via EBS only. Average size of this will be max 600-700 bytes.
    Program should be in pl/sql package or concurrent program or custom .fmb (d2k forms) or custom .rdf (d2k report) or through alert. I am not using samba.

  • Import/insert data from XML into Oracle database tables?

    Hi. (I am using JDeveloper 10.1.3.3.0 and Oracle 10g)
    I have been able to export the data from one of my database tables by using a View Object and .writeXML.
    Now, I want to take an xml file that is formatted in the same way as what is spit out by the writeXML and put that info in my database table. I followed online examples and have tried using .readXML like so:
    Element element = XMLDoc.getDocumentElement();
    vo.readXML(element, -1);
    I know it is sort of working, because at first I got an error message that one of the required attributes was missing. So, I added that attribute to my xml file and ran my code. No errors. But, I checked my database, and the new records were not added.
    Is there something I have done wrong? Or is there perhaps something I left out? I also noticed there were several versions of readXML like readFromXML. Which one should I use and how?
    Thanks.

    KUBA, I changed my code to match your example:
    DocumentBuilder db = DocumentBuilderFactory.newInstance().newDocumentBuilder();
    File xmlFile = new File("C:/myfilehere.xml");
    Document doc = db.parse(xmlFile);
    Element element = doc.getDocumentElement();
    vo.readXML(element, -1);
    vo.getDBTransaction().commit();
    I still get no errors, but my database table has no new records.
    Any ideas why?
    Thanks.

  • Upload vendor master data from legacy system to internal table tcode xk01

    through batch input program how to upload vendor master data from legacy system to internal table and then to SAP R/3 database(transaction XK01) by using recording method.

    By learning the basics of BDC recording and the use of GUI_UPLOAD

  • How to transfer data from excel files into z-tables

    Please help me with a code which transfers data from excel file to z-table.
    Thanks in advance
    Shuvir

    Hi Daniel,
    Export Data
    Purpose
    Use this procedure to export SAP data to a local file such as Microsoft Excel.
    Menu Path
    Use the following menu path to begin this process:
    ·         SystemèListèSaveèLocal File
    Helpful Hints
    When reviewing fields, R = Required,  O = Optional and C = Conditional.
    Procedure
    1.       Start the transaction using the menu path or transaction code.
          Whatever Data You Want to Export
    2.       Select SystemèListèSaveèLocal File.  This works well for any data in SAP.  This is the only option for the top-level (first page) of a report. 
    In a drill-down view within a report the Local File button  on the toolbar may be used and has the same options.
          Choose File Format
    3.       Click  .
    4.       Click  to continue.  If prompted for a format after choosing Spreadsheet, select Excel Table to get an Excel file that can be modified more easily.
          Choose File Save Location Step 1
    5.       Click  to the right of the Directory field to choose a different location.
          Choose File Save Location Step 2
    6.       Click  or browse your computer to locate the directory where you want to save your file.
    7.       Complete the following field:
    ·         File name:
        You must add the proper file extension to the name of your file (.xls for Excel, .rtf for Rich Text, .html for HTML).  The file extension tells your computer what program to open the file with.  If you do not have the file extension at the end, you may not be able to open it.
    8.       Click  to continue.
          Generate File in Location and Format Selected
    9.       Click  to create the file in the location and format selected.  In this example the file was named "example.xls" and saved on the desktop.
    Result
    You have completed the export process.
    thanks
    karthik

  • *Urgent*How to insert data from MS SQL to the table that create at the adobe form?

    Hi,
    I'm using Adobe life cycle designer 8 to do my interactive form. I would like to ask how to insert data from MS SQL to the table that i have created in my adobe interactive form?
    I really need the information ASAP as i need to hand in my project by next week... i really appreciate any one who reply this post.
    Thanks

    Tou need to do a couple of things
    1. On the Essbase server, set up an odbc system connection to your MySQL database
    2. In the load rule , go to the file menu and select open SQL data source and in the data source put in your SQL statement . A couple of hints. Where it says Select, don't put in the word select and where it say from don't put in from. The system adds them for you. The easiest way ti enter a SQL statement is to do it all in the select area So if your SQL would normanlly say select * from mytable just enter the code as * from mytable in the select area
    The click ol/retrieve and enter in your connection info. Itshould bring data back into the load rule. Save the load rule and use it

Maybe you are looking for

  • Photoshop lost in windows 8 re instillation.

    Hello. I'm afraid technology and myself are not best of friends. My sons  17 inch sony vaio laptop computer is a little over a year old. We purchased it from the Sony outlet uk store with photoshop elements (10 I think could be wrong) installed. over

  • What is the best way of integrate a jsp aplication created in jdev 3.2.3 with portal

    Hi, I've a jsp aplication made in jdeveloper 3.2.3 and i need to integrate this application into portal. What is the best way of doing this? thanks in advanced ricardo

  • Output Message Determination for Purchase Order

    Hi all ! Can anybody please explain in brief, the procedure for Ouyput message determination for Purchase order. (including printer settings) I have tried it throgh the Standard Configuration guide. but i am not able to do. Please explain step by ste

  • 2010 MBA with Samsung BX2231 monitor? (HDMI connector)

    Will my 2010 13" MBA work with this monitor? I read in this forum that connecting a MBA to a monitor via HDMI creates problems. Is this true? The Samsung BX2231 only has one D-sub and two HDMI connectors. (no DVI) BX2231 - Signal Input Video Signal A

  • Problem in selecting the count

    This the query which gives output as select substr(c.department_edesc,1,15)Department ,      substr(a.employee_code,1,8)Code,      substr(b.employee_edesc,1,20)Name ,      SUBSTR(min(a.log_time),1,8) INTIEM,      SUBSTR(max(a.log_time),1,8) OUTTIEM,