Need to insert selected records from PROD into TEST

I am trying to insert all records (for a specific region only) from production to test.
I'm a little confused about how the pl/sql would look for this.
Note that as I insert into the table in test, I also have a key field that is auto incremented by 1 each time.
The problem that I am having is I need to link two tables in PROD together to determine the region:
So in test, I want to do something like:
INSERT INTO ACCOUNT_PRICE
(select * from ACCOUNT_PRICE@PROD, MARKETER_ACCOUNT@PROD
where substr(MARKETER_ACCT_NO,1,1) = '3'
and MARKETER_ACCOUNT_NO = PRICE_ACCOUNT_NO);
However, i'm not sure if this is correct or if I should be using a BULK insert.
Note that I cannot just load the whole table as I need to restrict it to only one region of data.
Any help would be appreciated.
Sean

Direct load (BULK) is irrelevant to what you are asking. I would strongly suggest that you read the docs about this feature before considering it for any purpose.
As to your question what you are asking is unclear and, for reasons known only to you, you did not include a version number.
So given that I get to invent your version number I have decided you have 10g and therefore you have DataPump so my recommendation is to use
DataPump to extract and export the records you wish to move.
http://www.morganslibrary.org/reference/dbms_datapump.html

Similar Messages

  • Insertion of records from view into a table

    hello Friends,
    I have a view LGR is build on 12 table,this view has over 1 millon records, now when i run reports based on this view are so much slower, for speeding up reports i create a table LGRT and base all the reports on it, but the problem is that after any chage to the data of the LGR view , I delete all records from LGRT table and reinsert all records from LGR view
    delete from lgrt;
    insert into lgrt
    select *
    from lgr
    friends its a very long procedure what can i do to minimaze the human work.....
    i mean that it should be done automatically.

    Hello,
    It sounds like you could use a materialised view here to speed things up, also it will save you the hassle of deleting records from the temporary table etc as they offer quite a few synchronisation options. Have a look at the documentation here:
    http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/statements_63a.htm#SQLRF01302
    There a quite a few examples toward the bottom of the page.
    HTH

  • Select records from one database and insert it into another database

    Hi
    I need to write a statement to select records from one database which is on machine 1 and insert these records on a table in another database which is on machine 2. Following is what I did:
    1. I created the following script on machine 2
    sqlplus remedy_intf/test@sptd @load_hrdata.sql
    2. I created the following sql statements in file called load_hrdata.sql:
    rem This script will perform the following steps
    rem 1. Delete previous HR data/table to start w/ clean import tables
    rem 2. Create database link to HR database, and
    rem 3. Create User Data import table taking info from HR
    rem 4. Drop HRP link before exiting
    SET COPYCOMMIT 100
    delete from remedy.remedy_feed;
    commit;
    COPY FROM nav/donnelley@hrp -
    INSERT INTO remedy.remedy_feed -
    (EMPLID, FIRST_NAME, MI, LAST_NAME, BUSINESS_TITLE, WORK_PHONE, -
    RRD_INTRNT_EMAIL, LOCATION, RRD_OFFICE_MAIL, RRD_BUS_UNIT_DESCR) -
    USING SELECT EMPLID, FIRST_NAME, MI, LAST_NAME, BUSINESS_TITLE, WORK_PHONE, -
    RRD_INTRNT_EMAIL, LOCATION, RRD_OFFICE_MAIL, RRD_BUS_UNIT_DESCR -
    FROM ps_rrd_intf_medium -
    where empl_status IN ('A', 'L', 'P', 'S', 'X')
    COMMIT;
    EXIT;
    However, whenever I run the statement I keep getting the following error:
    SP2-0498: missing parenthetical column list or USING keyword
    Do you have any suggestions on how I can fix this or what am I doing wrong?
    Thanks
    Ali

    This doesn't seem to relate to Adobe Reader. Please let us know the product you are using so we may redirect you or refer to the list of forums at http://forums.adobe.com/

  • Selecting Records from 125 million record table to insert into smaller table

    Oracle 11g
    I have a large table of 125 million records - t3_universe.  This table never gets updated or altered once loaded,  but holds data that we receive from a lead company.
    I need to select records from this large table that fit certain demographic criteria and insert those into a smaller table - T3_Leads -  that will be updated with regard to when the lead is mailed and for other relevant information.
    My question is what is the best (fastest) approach to select records from this 125 million record table to insert into the smaller table.  I have tried a variety of things - views, materialized views, direct insert into smaller table...I think I am probably missing other approaches.
    My current attempt has been to create a View using the query that selects the records as shown below.  Then use a second query that inserts into T3_Leads from this View V_Market.  This is very slow. Can I just use an Insert Into T3_Leads with this query - it did not seem to work with the WITH clause?    My Index on the large table is t3_universe_composite and includes zip_code, address_key, household_key. 
    CREATE VIEW V_Market  as
    WITH got_pairs    AS  
         SELECT /*+ INDEX_FFS(t3_universe t3_universe_composite) */  l.zip_code, l.zip_plus_4, l.p1_givenname, l.surname, l.address, l.city, l.state, l.household_key, l.hh_type as l_hh_type, l.address_key, l.narrowband_income, l.p1_ms, l.p1_gender, l.p1_exact_age, l.p1_personkey, e.hh_type as filler_data, 1.p1_seq_no, l.p2_seq_no 
         ,      ROW_NUMBER () OVER ( PARTITION BY  l.address_key 
                                      ORDER BY      l.hh_verification_date  DESC 
                      ) AS r_num   
         FROM   t3_universe  e   
         JOIN   t3_universe  l  ON   
                l.address_key  = e.address_key
                AND l.zip_code = e.zip_code
              AND   l.p1_gender != e.p1_gender
                 AND   l.household_key != e.household_key         
                 AND  l.hh_verification_date  >= e.hh_verification_date 
      SELECT  * 
      FROM  got_pairs
      where l_hh_type !=1 and l_hh_type !=2 and filler_data != 1 and filler_data != 2 and zip_code in (select * from M_mansfield_02048) and p1_exact_age BETWEEN 25 and 70 and narrowband_income >= '8' and r_num = 1
    Then
    INSERT INTO T3_leads(zip, zip4, firstname, lastname, address, city, state, household_key, hh_type, address_key, income, relationship_status, gender, age, person_key, filler_data, p1_seq_no, p2_seq_no)
    select zip_code, zip_plus_4, p1_givenname, surname, address, city, state, household_key, l_hh_type, address_key, narrowband_income, p1_ms, p1_gender, p1_exact_age, p1_personkey, filler_data, p1_seq_no, p2_seq_no
    from V_Market;

    I had no trouble creating the view exactly as you posted it.  However, be careful here:
    and zip_code in (select * from M_mansfield_02048)
    You should name the column explicitly rather than select *.  (do you really have separate tables for different zip codes?)
    About the performance, it's hard to tell because you haven't posted anything we can use, like explain plans or traces but simply encapsulating your query into a view is not likely to make it any faster.
    Depending on the size of the subset of rows you're selecting, the /*+ INDEX hint may be doing your more harm than good.

  • Performance problem with selecting records from BSEG and KONV

    Hi,
    I am having performance problem while  selecting records from BSEG and KONV table. As these two tables have large amount of data , they are taking lot of time . Can anyone help me in improving the performance . Thanks in advance .
    Regards,
    Prashant

    Hi,
    Some steps to improve performance
    SOME STEPS USED TO IMPROVE UR PERFORMANCE:
    1. Avoid using SELECT...ENDSELECT... construct and use SELECT ... INTO TABLE.
    2. Use WHERE clause in your SELECT statement to restrict the volume of data retrieved.
    3. Design your Query to Use as much index fields as possible from left to right in your WHERE statement
    4. Use FOR ALL ENTRIES in your SELECT statement to retrieve the matching records at one shot.
    5. Avoid using nested SELECT statement SELECT within LOOPs.
    6. Avoid using INTO CORRESPONDING FIELDS OF TABLE. Instead use INTO TABLE.
    7. Avoid using SELECT * and Select only the required fields from the table.
    8. Avoid nested loops when working with large internal tables.
    9. Use assign instead of into in LOOPs for table types with large work areas
    10. When in doubt call transaction SE30 and use the examples and check your code
    11. Whenever using READ TABLE use BINARY SEARCH addition to speed up the search. Be sure to sort the internal table before binary search. This is a general thumb rule but typically if you are sure that the data in internal table is less than 200 entries you need not do SORT and use BINARY SEARCH since this is an overhead in performance.
    12. Use "CHECK" instead of IF/ENDIF whenever possible.
    13. Use "CASE" instead of IF/ENDIF whenever possible.
    14. Use "MOVE" with individual variable/field moves instead of "MOVE-
    CORRESPONDING" creates more coding but is more effcient.

  • Selecting record from a variable table

    Hi,
    I need to display the records from a table and the table name is saved in a variable. I am writing the code like
    create or replace procedure test_col as
         t_name VARCHAR2(40);
         V_ID VARCHAR2(10);
         cursor c_table is SELECT TABLE_NAME FROM ALL_TAB_COLS WHERE COLUMN_NAME = 'E_ID';
    begin
         OPEN C_TABLE;
         LOOP
              FETCH C_TABLE INTO T_NAME;
              EXIT WHEN C_TABLE%NOTFOUND;
              DBMS_OUTPUT.PUT_LINE(T_NAME);
              SELECT E_ID INTO V_ID FROM T_NAME;
              DBMS_OUTPUT.PUT_LINE(V_ID);
         END LOOP;     
    CLOSE C_TABLE;
    end;
    Its giving the error as table name doesn't exist. Its taking t_name as the table name but i wan to use the value saved in that variable as the table name;
    Any help..
    Thanks
    Ashish

    CREATE OR REPLACE PROCEDURE test_col
    AS
       t_name   VARCHAR2 (40);
       v_id     VARCHAR2 (10);
       CURSOR c_table
       IS
          SELECT table_name
            FROM all_tab_cols
           WHERE column_name = 'E_ID';
    BEGIN
       OPEN c_table;
       LOOP
          FETCH c_table
           INTO t_name;
          EXIT WHEN c_table%NOTFOUND;
          DBMS_OUTPUT.put_line (t_name);
          EXECUTE IMMEDIATE 'SELECT e_id FROM ' || t_name
                       INTO v_id;
          DBMS_OUTPUT.put_line (v_id);
       END LOOP;
       CLOSE c_table;
    END;
    /

  • Insert multiple records from web dynpro

    Hi,
    How to insert multiple records from web dynpro applications to SAP backend system ?
    Thanks,
    sowmya

    Hi soumya..
       if want to multiple row selected  then save into the Sap back End..
       value node--table.
    Backend value node=table_bapi_input;
       back end internal table --tableback.
    int size=wdcontext.nodeTable().size();
    int lead=wdcontext.nodeTable().getLeadSelection();
    table_bapi_input in=new table_bapi_input();
    wdcontext.nodetable_bapi_input().bind(in);
       for(int i=size-1;i>0;i--){
    tableback set=new tableback()
    if(lead==i || wdcontext.nodeTable().ismultiSelection(i)){
    set.setName(wdContext.nodeTable().getTableElementAt(i).getName();
    in.addZc_input(set);
    wdContext.currenttable_bapi_inputElement().modelobject().excute();
    wdContext.nodeOutput().invalidate();
    thanks
    jati

  • How to insert select columns from one internal table to another

    Hi,
    How to insert select columns from one internal table to another based on condition as we do from a standart table to internal table.
    regards,
    Sriram

    Hi,
    If your question is for copying data from 1 int table to other ;
    we can use
    APPEND LINES OF it_1 TO it_2.
    or if they have different columns then:
    loop at it_1 into wa_it1.
    move wa_it1-data to wa_it2-d1.
    apped wa_it2 to it_2.
    clear wa_it2.
    endloop.
    thnxz

  • JSF - Problem in Retrieving selected record from datatable

    I am new to JSF and in the process of developing a new web application using JSF.
    I have problem in retrieving the selected record from a datatable. I am using h:datatable tag and h:commandlink in a column for selecting a particular row on the datatable.
    I have populated the data to the datatable by binding a bean and its property.
    When I retrieve also I am binding to a bean in the action attribute of the h:commandlink tag in h:column of that datatable.But when I try to bind the bindign attribute of the h:datatable tag to the datatable instance in my Bean , my JSF File gets corrupted..
    How to implement this without any issue??plz help me regarding this.

    HI
    Try the below code
    DATA lo_nd_del TYPE REF TO if_wd_context_node.
    DATA lo_el_del TYPE REF TO if_wd_context_element.
    DATA ls_del TYPE wd_this->Element_del.
    DATA lo_nd_et_postab_1 TYPE REF TO if_wd_context_node.
    DATA lo_el_et_postab_1 TYPE REF TO if_wd_context_element.
    DATA ls_et_postab_1 TYPE wd_this->Element_del.
    DATA lt_et_postab_1 TYPE wd_this->Elements_del.
    DATA: wa_temp TYPE REF TO if_wd_context_element,
    lt_temp TYPE wdr_context_element_set.
    * navigate from <CONTEXT> to <ET_POSTAB_1> via lead selection
    lo_nd_et_postab_1 = wd_context->path_get_node( path = `ZSHP_EXTENDED_DUE_LI.CHANGING_3.ET_POSTAB_1` ).
    CALL METHOD lo_nd_et_postab_1->get_selected_elements
    RECEIVING
    set = lt_temp.
    * navigate from <CONTEXT> to <DEL> via lead selection
    lo_nd_et_postab_1 = wd_context->get_child_node( name = wd_this->wdctx_del ).
    LOOP AT lt_temp INTO wa_temp.
    CALL METHOD wa_temp->get_static_attributes
    IMPORTING
    static_attributes = ls_et_postab_1.
    ls_et_postab_1-vbeln = del. // adding new attribute value.
    APPEND ls_et_postab_1 TO lt_et_postab_1.
    CLEAR ls_et_postab_1.
    ENDLOOP.
    lo_nd_et_postab_1->bind_table( new_items = lt_et_postab_1 ).

  • How to import select photos from Iphoto into Adobe Elements

    How to import select photos from Iphoto into Adobe Elements

    If you wish to import in Elements Organizer here is the guide to help you out with all you need to use iPhoto and Organizer. http://helpx.adobe.com/elements-organizer/using/import-media-iphoto-library-mac.html
    If you wish to set PSE Editor as your editor for iPhoto images then here is the help link to guide you for the same - http://helpx.adobe.com/photoshop-elements/kb/photoshop-elements-iphoto-mac-os.html
    Hope it helps.
    Thanks,
    Garry

  • How to write jsp select record from Oracle  divide per page , about 50 reco

    Dear Expert,
    How to write jsp select record from Oracle divide per page , about 50 record per page.
    Thank you very much.

    I wish I could, but there is no single sign on module available for Fusion, also, so called Fusion is yet another Word With Big Letters, behind it there is yet another OC4J ( now Oracle switched to Weblogic though) container with bunsh of Oracle apps residing in it.
    Generally speaking, neither Fusion nor Oracle Apps user database does not have any single authentication module available out of the box to integrate user database.
    It's a long sad story running straight from Oracle Apps 11.0.5.
    That's why I've created JAAS single sign on login module and used it ever since at OC4J 10.2 and onwards at OC4J 10.3
    Back to the topic: to develop Apps and test them externally using the session bean I've isted above, one need to copy certain libraries from Oracle Apps server, then add them as libraries for JDeveloper project.
    Here is the complete list:
    oracle.apps.fnd.cache
    oracle.apps.fnd.cache
    oracle.apps.fnd.common
    oracle.apps.fnd.functionSecurity
    oracle.apps.fnd.metadata
    oracle.apps.fnd.security
    oracle.apps.fnd.util
    oracle.apps.jtf.cache
    oracle.apps.jtf.security
    Edited by: Faceless on Nov 26, 2009 3:04 AM

  • When I insert a photo from iPhoto into my iMovie, the photo that appears in the movie is different from the one that I inserted - why is this and how can I make it work properly?

    When I insert a photo from iphoto into imovie, the photo that appears is different from the one that I inserted.  Why is this and how can I make it work properly?

    WHat version of iMovie, and iPhoto?
    THIs forum is for iMovie iOS (iPads, iPhones).
    Are you talking about iMovie for Mac?

  • Download only selected record from ALV

    Hi
      I want to download only selected records from ALV output with button.
    i hav to fix the button on ALV screen using &ZDL whenever user presses the button record should be downloaded.
    Pl with coding
    its very very urgent.

    Hi ,
    i dont have the exact code which suits to your requirement
    but declare the internal table
    like
    data: begin of itab occurs 0,
      check type c,
    fields
    end of itab.
    while filling the field catalog
    fieldcatalog-checkbox = 'X'
    for this check field.
    and display the grid
    now write this subroutine
    *&      Form  USER_COMMAND
          Called from within the ALV processes. Currently, '&IC1' is used
          to process the hotspot and display the document 'picked' by the
          user.
          PV_UCOMM    contains the sy-ucomm from ALV
          SELFIELD is a structure that contains all the data required to
                   process a user selection. The following is an example
                   of the SELFIELD structure and sample values:
    FORM USER_COMMAND USING PV_UCOMM LIKE SY-UCOMM
                            SELFIELD TYPE SLIS_SELFIELD.
      CASE PV_UCOMM.
        WHEN '&IC1'.
          loop at itab where check = 'X'.
    append all these records to another internal table itab1
         endloop.
    call function gui_download.
    pass the internal table itab1 in the tables statement
    and also you have to give the file path that may be static or dynamic
    if dynamic you have to call the function module
    f4_filename
    and get the filename and pass the same value to gui_download
    that will be download to the above said path
    endcase.
    end form.
    reward points if helpful,
    thanks & regards,
    venkatesh

  • Selecting record from cdpos

    Hi SAP team,
    How to select record from CDPOS when value_old field is initial. For currency field .
    Thanks & Rgds,
    Santhosh Kumar.
    Moderator message: please search for information and try yourself before asking.
    Edited by: Thomas Zloch on Mar 9, 2011 3:52 PM

    Since the problem is related to a custom IDoc, it is the process code of said IDoc where you will have to look. Depending on how the condition records are updated, this will be responsible for writing correct change documents.
    If the process code uses a standard BAPI, then change documents should be written correctly. Otherwise, the code should take care of writing the correct change documents after updating the condition records.
    Often it is possible to update a business object with calling a standard function module, but change documents will not always be written since that is done separately in the usual update process. For instance, you can update a delivery by using RV_DELIVERIES_UPDATE but that won't write change documents by itself at all. So take a look at the process code and investigate how the condition records are updated. Then you'll see the way the change documents are handled.

  • Migrate DRM application from PROD to TEST environment

    How I can migrate all DRM application from PROD to TEST environment. The first way this is using migrate utility and then create all export/import utility. But this way does not give 100% guaranty of identity the PROD and TEST environment.
    As relation database I am using Oracle DB. Can I migrate DRM application using exp/imp utility for oracle users (MDM and MDM_DB) and after that changing information directly in oracle tables in the TEST environment?

    This response is not timely but others may find it useful...
    You can use the Oracle database export and import processes, but there are several additional steps in the process. In general this is a high risk endevour that should not be attempted by the faint of heart. (See #3 below!) Attempt at your own peril.
    1) Make a copy of the Username table so that you have the Test versions of the encrypted passwords for DRM internally managed accounts. These will need to be updated post import if there are any differences.
    2) After you delete the tables in Test, it's best to create them with the install scripts prior to import because once an Oracle table containing a blob datatype has a stored value the Oracle import is no longer tolerant of changes in target tablespace names for all tables containing blobs within that schema. (Known bug) However, the create tables install script has an insert statement or two that need to be commented out or the import will create duplicate rows that will cause errors enabling constraints.
    3) After the import completes all exports and books need to be modified to no longer point to production target locations, especially for exports to database tables! Ideally this step would be completed and QA'd prior to starting the application server; however, the application server must be running if the migration utility is going to be leveraged to propagate these updates so the process I use is to lockout all users until this step is completed.
    4) Also note that if the Prod and Test app servers are not using the same authentication settings the system preference needs to be changed or the application server may not start.

Maybe you are looking for