Bulk select from source

I am trying to insert into my target table by selecting all records at once from source table. For this I need to use a DB link because source and target are on different databases, but cannot get ODI to place the DB link at the correct position when I modify the Knowledge Module (LKM SQL to SQL).
We did this optimization on another ODI process where the source and target are in the same database and it speeds up loading a lot.
I changed the Load Data command of the KM as such:
Removed the code in Command in Source
Added the following to Command in Target:
insert /*+ APPEND */ into <%=snpRef.getTable("L", "COLL_NAME", "A")%>
<%=snpRef.getColList("", "[CX_COL_NAME]", ",\n\t", "","")%>
select     <%=snpRef.getPop("DISTINCT_ROWS")%>
     <%=snpRef.getColList("", "[EXPRESSION]\t[ALIAS_SEP] [CX_COL_NAME]", ",\n\t", "", "")%>
from <%=snpRef.getFrom()%>@billing.xxx.com
where (1=1)
<%=snpRef.getFilter()%>
<%=snpRef.getJrnFilter()%>
<%=snpRef.getJoin()%>
<%=snpRef.getGrpBy()%>
<%=snpRef.getHaving()%>
The execution failed and when I check the Description in the Operator, it contains the following code:
insert /*+ APPEND */ into BIUSER.C$_0DIM_APN
C1_ACCESS_POINT_NAME_V
select     
GPRS_HOME_CDRS.ACCESS_POINT_NAME_V     C1_ACCESS_POINT_NAME_V
from ABILLITY3.GPRS_HOME_CDRS [email protected]
where (1=1)
And (GPRS_HOME_CDRS.CALL_DATE_DT >= sysdate -1)
The problem is that is places the DB link after the table alias. I tried to move the DB link inside the value : <%=snpRef.getFrom()%> but then I get a lot of errors.
Please help.
Kind regards
Bonita

Good day,
I tried this, but get stuck again. Will you please assist.
I copied your code in my LKM SQL to SQL.
I am getting an error in this part:
@<%=snpRef.getInfo("SRC_DSERV_NAME")%>
I tried several ways to define the source data server name. (I tried the DB link created by our DBA, the JDBC URL in the topology and even 'hardcoded' the name)
The error:
declare cursor myCursor is
select     
EXPRESSION     ALIAS_SEP CX_COL_NAME,
     EXPRESSION     ALIAS_SEP CX_COL_NAME,
     EXPRESSION     ALIAS_SEP CX_COL_NAME,
     EXPRESSION     ALIAS_SEP CX_COL_NAME,
     EXPRESSION     ALIAS_SEP CX_COL_NAME,
     EXPRESSION     ALIAS_SEP CX_COL_NAME,
     EXPRESSION     ALIAS_SEP CX_COL_NAME,
     EXPRESSION     ALIAS_SEP CX_COL_NAME,
     EXPRESSION     ALIAS_SEP CX_COL_NAME,
     EXPRESSION     ALIAS_SEP CX_COL_NAME,
     EXPRESSION     ALIAS_SEP CX_COL_NAME,
     EXPRESSION     ALIAS_SEP CX_COL_NAME,
     EXPRESSION     ALIAS_SEP CX_COL_NAME,
     EXPRESSION     ALIAS_SEP CX_COL_NAME,
     EXPRESSION     ALIAS_SEP CX_COL_NAME,
     EXPRESSION     ALIAS_SEP CX_COL_NAME,
     EXPRESSION     ALIAS_SEP CX_COL_NAME,
     EXPRESSION     ALIAS_SEP CX_COL_NAME,
     EXPRESSION     ALIAS_SEP CX_COL_NAME,
     EXPRESSION     ALIAS_SEP CX_COL_NAME,
     EXPRESSION     ALIAS_SEP CX_COL_NAME,
     EXPRESSION     ALIAS_SEP CX_COL_NAME,
     EXPRESSION     ALIAS_SEP CX_COL_NAME,
     EXPRESSION     ALIAS_SEP CX_COL_NAME,
     EXPRESSION     ALIAS_SEP CX_COL_NAME,
     EXPRESSION     ALIAS_SEP CX_COL_NAME,
     EXPRESSION     ALIAS_SEP CX_COL_NAME,
     EXPRESSION     ALIAS_SEP CX_COL_NAME,
     EXPRESSION     ALIAS_SEP CX_COL_NAME,
     EXPRESSION     ALIAS_SEP CX_COL_NAME
from     ABILLITY3.MMS_HOME_CDRS@[PROPERTY: "BILLING.MTC.COM.NA" not found.] !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! error
where     (1=1)
And (MMS_HOME_CDRS.PROCESSED_DATE_D >= sysdate -2 and
MMS_HOME_CDRS.PROCESSED_DATE_D < sysdate )
TYPE V_TABLE_TYPE IS TABLE OF myCursor%ROWTYPE; V_TABLE_ARRAY V_TABLE_TYPE; begin
     /* Loop over the Cursor and execute the insert statement */
     OPEN myCursor;
     LOOP
     FETCH myCursor BULK COLLECT INTO V_TABLE_ARRAY LIMIT 10000;
     FORALL I IN 1..V_TABLE_ARRAY.COUNT
          insert /*+ APPEND */ into     Exception getTable("L", "FACT_ABIL_MMS_TB", "A") : Unknown flexfield code.
               VALUES V_TABLE_ARRAY(I);
     COMMIT;
     EXIT WHEN myCursor%NOTFOUND;
END LOOP;
CLOSE myCursor;
end;
Ok, then I hardcoded the source data server name. It pass the previous error, but then I am getting this error:
com.sunopsis.sql.SnpsMissingParametersException: Missing parameter
     at com.sunopsis.sql.SnpsQuery.completeHostVariable(SnpsQuery.java)
     at com.sunopsis.sql.SnpsQuery.updateExecStatement(SnpsQuery.java)
     at com.sunopsis.sql.SnpsQuery.executeUpdate(SnpsQuery.java)
     at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execStdOrders(SnpSessTaskSql.java)
     at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java)
     at com.sunopsis.dwg.dbobj.SnpSessTaskSqlC.treatTaskTrt(SnpSessTaskSqlC.java)
     at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java)
     at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java)
     at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java)
     at com.sunopsis.dwg.cmd.DwgCommandSession.treatCommand(DwgCommandSession.java)
     at com.sunopsis.dwg.cmd.DwgCommandBase.execute(DwgCommandBase.java)
     at com.sunopsis.dwg.cmd.e.i(e.java)
     at com.sunopsis.dwg.cmd.h.y(h.java)
     at com.sunopsis.dwg.cmd.e.run(e.java)
     at java.lang.Thread.run(Thread.java:534)
My code:
declare cursor myCursor is
select     <%=snpRef.getPop("DISTINCT_ROWS")%>
<%=snpRef.getColList("", "EXPRESSION\tALIAS_SEP CX_COL_NAME", ",\n\t", "", "")%>
from     <%=odiRef.getSrcTablesList("", "ABILLITY3.MMS_HOME_CDRS", ", ", "")%>@196.20.21.32:1521:mtcabill
where     (1=1)
<%=snpRef.getFilter()%>
<%=snpRef.getJoin()%>
<%=snpRef.getJrnFilter()%>
<%=snpRef.getGrpBy()%>
<%=snpRef.getHaving()%>;
TYPE V_TABLE_TYPE IS TABLE OF myCursor%ROWTYPE; V_TABLE_ARRAY V_TABLE_TYPE; begin
     /* Loop over the Cursor and execute the insert statement */
     OPEN myCursor;
     LOOP
     FETCH myCursor BULK COLLECT INTO V_TABLE_ARRAY LIMIT 10000;
     FORALL I IN 1..V_TABLE_ARRAY.COUNT
insert /*+ APPEND */ into <%=snpRef.getTable("L", "COLL_NAME", "A")%>
     <%=snpRef.getColList("", "[CX_COL_NAME]", ",\n\t", "","")%>
values V_TABLE_ARRAY(I);
     COMMIT;
     EXIT WHEN myCursor%NOTFOUND;
END LOOP;
CLOSE myCursor;
end;
Kind regards and thank you for assisting me.
Bonita

Similar Messages

  • Insert/select one million rows at a time from source to target table

    Hi,
    Oracle 10.2.0.4.0
    I am trying to insert around 10 million rows into table target from source as follows:
    INSERT /*+ APPEND NOLOGGING */ INTO target
    SELECT *
    FROM source f
    WHERE
            NOT EXISTS(SELECT 1 from target m WHERE f.col1 = m.col2 and f.col2 = m.col2);There is a unique index on target table on col1,col2
    I was having issues with undo and now I am getting the follwing error with temp space
    ORA-01652: unable to extend temp segment by 64 in tablespace TEMPI believce it would be easier if I did bulk insert one million rows at a time and commit.
    I appriciate any advice on this please.
    Thanks,
    Ashok

    902986 wrote:
    NOT EXISTS(SELECT 1 from target m WHERE f.col1 = m.col2 and f.col2 = m.col2);
    I don't know if it has any bearing on the case, but is that WHERE clause on purpose or a typo? Should it be:
            NOT EXISTS(SELECT 1 from target m WHERE f.col1 = m.COL1 and f.col2 = m.col2);Anyway - how much of your data already exists in target compared to source?
    Do you have 10 million in source and very few in target, so most of source will be inserted into target?
    Or do you have 9 million already in target, so most of source will be filtered away and only few records inserted?
    And what is the explain plan for your statement?
    INSERT /*+ APPEND NOLOGGING */ INTO target
    SELECT *
    FROM source f
    WHERE
            NOT EXISTS(SELECT 1 from target m WHERE f.col1 = m.col2 and f.col2 = m.col2);As your error has to do with TEMP, your statement might possibly try to do a lot of work in temp to materialize the resultset or parts of it to maybe use in a hash join before inserting.
    So perhaps you can work towards an explain plan that allows the database to do the inserts "along the way" rather than calculate the whole thing in temp first.
    That probably will go much slower (for example using nested loops for each row to check the exists), but that's a tradeoff - if you can't have sufficient TEMP then you may have to optimize for less usage of that resource at the expense of another resource ;-)
    Alternatively ask your DBA to allocate more room in TEMP tablespace. Or have the DBA check if there are other sessions using a lot of TEMP in which case maybe you just have to make sure your session is the only one using lots of TEMP at the time you execute.

  • Load from Source-Destination=?Table structure not the same.

    Hi
    I have to copy data from source table to destination table. The structure of the 2 are not the same. Number of records in destination table should be half number of records in source. The reason being in the source a column named (e.g.) c_type = 'Up' - one row or 'Down' - in another row. The same is reprsented in the destination as 1 row since the number of columns is more. Example up_name, down_name, up_dep, down_dep.
    How can I insert into the destination depending on the c_type column in the source?
    Example:
    I want to insert into destination.up_name where c_type = 'Up' and destination.down_name where c_type = 'Down'...
    and so onHow can I write my sql query such that I have to write one insert statement and put the right data in the right column?

    Mass25 wrote:
    Number of records in destination table should be half number of records in source. The reason being in the source a >column named (e.g.) c_type = 'Up' - one row or 'Down' - in another row. The same is reprsented in the destination >as 1 row since the number of columns is more. Example up_name, down_name, up_dep, down_dep. Hope this is what you are looking for:
    SQL> WITH SOURCE AS
      2       (SELECT 1 id_col, 'UP' c_type, 'up_name_1' name_col,
      3               'up_dept_1' dept_name
      4          FROM DUAL
      5        UNION ALL
      6        SELECT 1 id_col, 'DOWN' c_type, 'down_name_1' name_col,
      7               'down_dept_1' dept_name
      8          FROM DUAL
      9        UNION ALL
    10        SELECT 2 id_col, 'UP' c_type, 'up_name_2' name_col,
    11               'up_dept_2' dept_name
    12          FROM DUAL
    13        UNION ALL
    14        SELECT 2 id_col, 'DOWN' c_type, 'down_name_2' name_col,
    15               'down_dept_2' dept_name
    16          FROM DUAL
    17        UNION ALL
    18        SELECT 3 id_col, 'UP' c_type, 'up_name_3' name_col,
    19               'up_dept_3' dept_name
    20          FROM DUAL
    21        UNION ALL
    22        SELECT 3 id_col, 'DOWN' c_type, 'down_name_3' name_col,
    23               'down_dept_3' dept_name
    24          FROM DUAL)
    25  SELECT * FROM SOURCE
    26  /
        ID_COL C_TY NAME_COL    DEPT_NAME
             1 UP   up_name_1   up_dept_1
             1 DOWN down_name_1 down_dept_1
             2 UP   up_name_2   up_dept_2
             2 DOWN down_name_2 down_dept_2
             3 UP   up_name_3   up_dept_3
             3 DOWN down_name_3 down_dept_3
    6 rows selected.
    SQL> WITH SOURCE AS
      2       (SELECT 1 id_col, 'UP' c_type, 'up_name_1' name_col,
      3               'up_dept_1' dept_name
      4          FROM DUAL
      5        UNION ALL
      6        SELECT 1 id_col, 'DOWN' c_type, 'down_name_1' name_col,
      7               'down_dept_1' dept_name
      8          FROM DUAL
      9        UNION ALL
    10        SELECT 2 id_col, 'UP' c_type, 'up_name_2' name_col,
    11               'up_dept_2' dept_name
    12          FROM DUAL
    13        UNION ALL
    14        SELECT 2 id_col, 'DOWN' c_type, 'down_name_2' name_col,
    15               'down_dept_2' dept_name
    16          FROM DUAL
    17        UNION ALL
    18        SELECT 3 id_col, 'UP' c_type, 'up_name_3' name_col,
    19               'up_dept_3' dept_name
    20          FROM DUAL
    21        UNION ALL
    22        SELECT 3 id_col, 'DOWN' c_type, 'down_name_3' name_col,
    23               'down_dept_3' dept_name
    24          FROM DUAL)
    25  SELECT s1.id_col, s1.name_col up_name, s1.dept_name up_dept,
    26         s2.name_col down_name, s2.dept_name down_dept
    27    FROM SOURCE s1 JOIN SOURCE s2
    28         ON (s1.id_col = s2.id_col AND s1.c_type = 'UP' AND s2.c_type = 'DOWN
    29  /
        ID_COL UP_NAME     UP_DEPT     DOWN_NAME   DOWN_DEPT
             1 up_name_1   up_dept_1   down_name_1 down_dept_1
             2 up_name_2   up_dept_2   down_name_2 down_dept_2
             3 up_name_3   up_dept_3   down_name_3 down_dept_3
    3 rows selected.
    SQL>Source had 6 records and it was self joined to give 3 records which can be populated in Destination Table.
    Always post some sample data with desired result. That will get you quick responses.
    Regards,
    Jo
    Edited: Added Quote Tags

  • I want to remove volumes from 'Import' - 'Select a source' list

    Hi all,
    First, I'm using the new Lightroom v4.1 on a Windows 7 x64 system.
    As the title to my question suggests, I'm trying (without success) to remove volumes from the list that's shown when a user clicks on the 'Import' button (lower left of screen) and 'Select a source' which, naturally, shows all the drives in my system.
    There are five volumes; four internal and one external.
    There are only two drives which contain photos that I'm interestered in importing/editing.
    The other drives contain files that I have no interest in editing or organizing.
    For example, several hundred (scanned and collected) very old family photos that I wish to keep pristine, with no editing of any kind. As for placing them in collections,  I already have them in dated, carefully named folders.
    So, as this is a shared computer, I want to remove the volumes (drives) so that the aforementioned photos can't be inadvertantly imported.
    Can someone please point me in the right direction how to do this?
    Thank you.
    Yours,
    Hugh

    There is nothing within Lightroom that will cause it to ignore a specific drive permanently. You'd have to go above Lightroom to the system level to prevent Lightroom from seeing the drive. Not sure how to do that, but it's probably possible.

  • How to use insert into...select * from...if source table is huge in size

    The source tables are having crores of data (growing tables). Tables with 4crores, 17cr. We want these tables to be copied frequently to our local database. Previously it was done by export-import through windows scheduled task. but now we are planning to do it as database jobs. We are fetching the datas with query
    insert into dest_tablee( select * from source_table@dblink) when we tried with this it was throwing exception like enough table space is not there. And also it was found that frequent commits has to be used while populating datas from big tables. So tried with cursor But it was very slow and again we got the exception like 'the table space unable to extend segment by 16 in undo tablespace 'UNDOTBS1'.
    After that we tried with the group by. In this case we got the exception like unable to extend table and also index in the table space. For this the solution is to add datafile. Again we have increase the table space. Now the procedure is running very slow(taking much time. It might be because of the conditions used in the query).
    Is there any other option to copy the datas from such a big tables? can we use the same sort of query?
    Friends please help me to sort it out.
    Thanks in Advance

    Hi,
    you have lot of data DONT use cursor, did you try using the COPY command.
    How frequently you will be doing the COPYING of the data ?
    If you have any constraints you can disable and enable after all the records have been copied.
    Please look at this link this should help.
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:5280714813869
    Thanks
    Message was edited by:
    hkandpal
    Link added

  • Selecting html source from the text pane

    Help!!
    I am selecting text in the HTMLEditor text pane but when I look at the selected text it does not include tags like image and table tags. I would like to somehow grab the selected html source based on what is selected in the text pane. Is there a way to map the selected text in the editor textpane to the html in the editor sourcepane? I have not been able to find an answer in previous threads.
    thanks,
    Steve

    here is the easiest way i know
    using JEditorPane from the swing package
    JEditorPane sourceViewer = new JEditorPane(http://www.google.com);
    System.out.println(sourceViewer.getText());
    or
    JTextArea.setText(sourceViewer.getText);
    several things to concider....
    1. you dont have to add the component to abuse it, ie you dont have to show the JEditorPane you can just use its functionality
    2. you cant JUST display the text in anything made to display html unless you removed the <html> tag. but that wont stop you from printing it or putting it into a JTextArea

  • How can i call the certificate selection dialog box from source code?

    How can i call the certificate selection dialog box from source code?
    NB: Of course if i have more than one certificate in the Microsoft Keystore 'My'.
    Thank You in advance

    I found an example of the "TestStand UI Expression Control.ctl" and it works just the way I need it. (check the link)
    Proper use of "TestStand UI ExpressionEdit Control" in LabVIEW http://forums.ni.com/ni/board/message?board.id=330&requireLogin=False&thread.id=10609 
    The "Expression Browser Dialog Box Button" F(x) stays disable while editing the VI, however it become available when the VI is called from TestStand.
    Thank you,
    Hecuba
    Mfg. Test Engineer
    Certified LabVIEW Associate Developer

  • ORA-00001:Unique Constraint while inserting 2 similar records from source

    Hi,
    in TEST1 there are records:
    10 20 ABC
    10 20 DEF
    I amt trying to insert into TEST which has CODE as Primary Key.
    declare
    type cur is ref cursor;
    cur_t cur;
    type v_t is table of TEST%rowtype;
    tab v_t;
    v_act_cnt_str VARCHAR2(4000);
    v_act_cnt NUMBER:=0;
    BEGIN
    v_act_cnt_str:=' SELECT COUNT(*) '||' FROM TEST '||' WHERE '||'('||CODE||')'||' IN '||'('||'SELECT '||CODE||' FROM TEST1'||')';
    DBMS_OUTPUT.PUT_LINE('The Actual Count String is'||v_act_cnt_str);
    EXECUTE IMMEDIATE v_act_cnt_str INTO v_act_cnt;
    open cur_t for select * from TEST1 ORDER BY ROWNUM;
    loop
    fetch cur_t bulk collect into tab limit 10000;
    if v_act_cnt=0 THEN
    forall i in 1..tab.count
    insert into TEST values tab(i);
    commit;
    ELSE
    v_merge_act_str :=
    'MERGE INTO TEST '||
    ' DEST' || ' USING TEST1 '||
    ' SRC' || ' ON (' || DEST.CODE=SRC.CODE || ')' ||
    ' WHEN MATCHED THEN ';
    first_str := 'UPDATE ' || ' SET ' ||
    'DEST.NAME=SRC.NAME,DEST.DEPT_NAME=SRC.DEPT_NAME;
    execute immediate v_merge_act_str || first_str;
    v_merge_act_str := '';
    first_str := '';
    commit;
    END IF;
    end loop;
    END;
    ITS GIVING ERROR as:
    ORA-00001: unique constraint (PK_TEST1) violated
    Any help will be needful for me
    Edited by: user598986 on Sep 22, 2009 4:20 AM
    Edited by: user598986 on Sep 22, 2009 4:22 AM

    Your code makes absolutely no sense whatsover. The whole point of MERGE is that it allows us to conditionally apply records from a source table as inserts or updates to a target table. So why have you coded two separate statements? And why are you using such horrible dynamic SQL?
    Sorry to unload on you, but you seem to have your code unnecessarily complicated, and that it turn makes it unnecessarily harder to debug. As an added "bonus" this approach will also perform considerably slower than a single MERGE statement. SQL is all about set operations. Don't do anything procedurally which can be done in a set.
    Cheers, APC
    blog: http://radiofreetooting.blogspot.com

  • Insert data from source table to destination table dependning up on a criteria.once inserted delete from source table.

    HI,
    I have a source table with millions of records .I need to insert some of the data (depending on a condition) to a repository table.
    Once they are inserted they can be deleted from the source table.
    The deletion is taking a lot of time .
    I need to reduce the time to delete the records.
    ex:-  1 million records in 8 seconds.
    Had already used bulk collect and cursors but cannot succeed.
    Please suggest how to increase the performance.
    Thanks & Regards

    APPROACH 1:-
    CREATE OR REPLACE PROCEDURE SP_BC
    AS
    DETAILS_REC SOURCETBL%ROWTYPE;
    COUNTER NUMBER:=1;
    RCOUNT NUMBER:= 1;
    START_TIME PLS_INTEGER;
    END_TIME PLS_INTEGER;
    CURSOR C1 IS
    SELECT * FROM SOURCETBL WHERE DOJ<SYDATE;
    BEGIN
    START_TIME := DBMS_UTILITY.GET_TIME;
        DBMS_OUTPUT.PUT_LINE(START_TIME/100);
        OPEN C1;
        LOOP
        FETCH C1 INTO DETAILS_ROW;
        EXIT WHEN  C1%NOTFOUND;
               BEGIN
                EXIT WHEN COUNTER >10000;
                INSERT INTO DESTINATIONTBL VALUES DETAILS_REC;
                IF SQL%FOUND THEN
                    DELETE FROM SOURCETABLE WHERE ID= DETAILS_REC.ID;
                  COUNTER:=COUNTER+1;
            END IF; 
        COMMIT;
            END;
         COUNTER:=1;
        END LOOP;
        COMMIT;
    END;
    APPROACH 2:-
        CREATE OR REPLACE PROCEDURE SP_BC1
    IS
    TYPE T_DET IS TABLE OF SOURCETBL%ROWTYPE;
    T_REC T_DET;
    BEGIN   
        SELECT *  BULK COLLECT INTO T_REC FROM SOURCETBL
         WHERE NAME=@NAME;
        FOR I IN  T_REC .FIRST ..T_REC .LAST
           LOOP
             INSERT INTO DESTINATIONTBL VALUES T_REC (I);
          IF SQL%FOUND THEN
          DELETE FROM SOURCETBL WHERE ID =
           WHERE ID = T_REC (I).ID;  
           END IF; 
           EXIT WHEN T_REC=0;
        END LOOP;
        COMMIT;
    END;
    APPROACH 3:-
    CREATE OR REPLACE PROCEDURE SP_BC2
    AS
    TYPE REC_TYPE IS TABLE OF SOURCETBL%ROWTYPE ;
    DETAILS_ROW REC_TYPE;
    CURSOR C1 IS
    SELECT * FROM
         SOURCETBL WHERE END<SYSDATE;
        BEGIN
        OPEN C1;
        LOOP
        FETCH C1 BULK COLLECT INTO DETAILS_ROW LIMIT 999;
        FORALL I IN 1..DETAILS_ROW.COUNT
                  /* A BATCH OF 999 RECORDS WILL BE CONSIDERED FOR DATA MOVEMENT*/
    INSERT INTO DESTINATIONTBL VALUES DETAILS_ROW(I);
    --            IF SQL%FOUND  THEN
    --                DELETE from SOURCETBL WHERE ID IN DETAILS_ROW(I).ID;
    --           END IF;
            EXIT WHEN  C1%NOTFOUND; 
        COMMIT;   
        END LOOP;
        COMMIT;
    3rd approach seems better but i have an issue with referring the fileds of a record type.

  • Bulk copy from a temp table

    My input is from a file. Since I do not have an ETL tool, I am using a stored proc to do the ETL (which also gives me an advantage, I do not have to unload the target table to do the join). So, I dump the file contents into a temp table and use it in proc.
    The query is like
    Insert into <target table1> (Select fields and some transformation from <temp table> where <key> not in target table and <some joins with other tables in database>
    Like this I have four queries for four target tables.
    The inserts from the temp table into the target table is very slow because the target has a lot of index and RI. I cannot drop & create the index since the application requirements does not give me that liberty.
    My only option is to insert in a temp table similar to the target but without any index/RI/PK and then dump it into a file and then use SQL loader to load the file contents into target table. This is relatively faster but is a very cumbersome route to me.
    Is there any other way to do bulk insert from one table to another table like SQL loader without using a file? Is there anyway to bypass the index update operation without dropping the index?
    My source will be almost 500,000 rows and target is having 9 million rows.

    Posts like this one are better avoided.
    Because
    - You don't post a version
    - You don't post the SQL
    - You don't post the EXPLAIN PLAN
    It is your assertion the INSERT is to blame, yet it can equally be the SELECT statement involved.
    Basically your post boils down to
    'It doesn't work. Please help', without any relevant information.
    I'm saying this because INSERT SELECT is the fastest method available. OK, you could try the APPEND hint, but in that case you would have to rebuild all indices. Something you state you can not do.
    BULK INSERTs will be slower, SQL*Loader will be slower too, as it involves SQLnet. INSERT SELECT is a server side operation.
    And the 'solution' to do this by means of a file... Ahem, let's not talk about it. It just doesn't work.
    Sybrand Bakker
    Senior Oracle DBA

  • Advance select for source file in Sender File Adapter

    Hi
    I am trying to utilise the parameter 'Advance Selection for source file' on a sender file adapter to pick the file from multiple folders
    My problem is that this parameter that is listed on the SAP help is not getting in File accessing Parameters.
    I am running PI 7.02 (NW702_07_Rel)
    Service pack 07
    Has anyone come across this before?
    any suggestions on how to do this?

    Hi,
    In PI7.0 the property exists. I have used it previously. I think SP was 13.
    Regards,
    Nutan
    Edited by: nutan champia on Nov 24, 2011 10:42 AM

  • Missing field from source DSO in transformation to other DSO

    Hi SDN,
    I am facing the following problem:
    I have created DSO "A" and a transformation rule to DSO "B". InfoObject 0RATE_TYPE is available in both DSOs... BUT: when I am creating the transformation rule the field from DSO "B" (on the right side) is not connected to any filed from source DSO "A" because there the field 0RATE_TYPE is not offered.
    What I have tried so far:
    - reactivate DSO "A"
    - remove 0RATE_TYPE from DSO "A", activate DSO "A", include 0RATE_TYPE again, reactivate DSO "A"
    - newly created DSO "A"
    All this has not resulted in any other than the problem described before. One thing I recoginized: when doubleclicking on the DSO "A" I see the field 0RATE_TYPE, when doing a right click and selecting "Object overview" the field is also missing!
    I have run out of ideas and I would like to see if any of you has had the same problem and has found any solution.
    PLEASE help me!
    Thank you in advance!!

    Hi,
    Did you try to logoff and logg on again?
    (sometimes BI show things after leaving the transaction)
    IS the DSO activated?
    Is the field compounded to another field that is not in the DSO?
    You might try a work around:
    Make a routine that reads your DSO to get the field.
    (If the ABAP-editor also gives an error on thing field something very strange is going on indeed)
    Success,
    Udo

  • Matrialized view not refreshing all records from source.

    My materialized view is not refreshing a fixed number of rows i.e 198 every time from source to target.What are the reasons for such behavior. Also what should i do to resolve this discrepancy.
    My mv is a FAST REFRESH ON DEMAND based on ROWID.
    It has a simple sql query select col1,col2,col3 from testschema.mytable@mydb;
    Thanks,
    Sandesh

    Hello Raman & KV,
    Thanks for your Suggestions.
    Unfortunately, I would not be able to implement any of your suggestions because, I m not allowed to change the DTP Settings.
    So, I m working on finding the root cause of this issue and came across a SAP Note - 1506944 - Only one package is always extracted during direct access , which says this is a Program Error.
    Hence, i m checking more with SAP on this and will share their insights once i hear back from them.
    Cheers
    Shiva

  • UPDATE : Toshiba Recovery Wizard 'cannot read from source file or disk' error (satellite L500)

    UPDATE 2: Phoned Toshiba tech support again, guided by techie to begin the recovery again. Just before phoning I was able to go into recovery options and view the drive setup and all the files that couldn't be read are on the CD so I've no idea why the error kept occuring, and neither did the techie. Fingers crossed it works this time but I'm not overly hopefully given that we've just done exactly the same as I did before.  UPDATE 1: I got into the BIOS and reset everything back to defaults and yay, my toshiba recovery wizard now starts! :-D  On the down side, when trying to do a factory default software / out of the box recovery I continually get error messages with regards to copying the files, for example 
    cannot read from source file or disk
    7z.dll
    Type application extension
    size 585kb
    date modified 7/14/2009 10.26pm
    other read / copy errors include PREINST6.SWM, BOOT_32, BOOTPRIORITY, CHECKMAXPTSIZE, CHGBOOT, CPU, CPUCHECK, CREATEPARTITION, CTRLDRVINFO, DISKWIPE, DMI, DPINST32, EBLIB.DLL, ERRORDIALOG, EW3BOOTSEQ, FWLINK, FWLINK.SYS, GETHDDINFO, GETKEYSTATE, IMAGEX, INFILED, INITRECAREA, KRAIADAPI.DLL ..... at which point I decided to 'skip all' :-/
    Any explanations as to what's going on and how I might be able to fix it would be very much appreciated! :-)  Thank you!
    I have a two and half year old satellite L500 with an Intel i-3 and 4 gigs of RAM, on which I was running Windows 7.
    Admittedly it’s had rather a hard life (I ran some very demanding CAD / graphics software on it) but it had always performed well until just recently, when after suffering several BSOD (which had never happened before), the hard drive failed.
    I partitioned and formatted a brand new hard drive (which is perfectly fine and functions normally when hooked up to another laptop with a SATA to USB cable) and obtained system recovery discs from Toshiba.  Unfortunately, when I try and run the first disc, windows starts to load files but then generates an error screen with the message Error F3-F100-0003 and a request to turn the computer off.  
    When I use the windows Memory Diagnostic to get into the Windows Boot Manager Screen I get the following;
    Windows failed to start.  A recent hardware / software change might be the case.
    To fix the problem
    Insert your windows installation disc and restart your computer
    Choose your language settings and click ‘next’
    Click ‘repair your computer’
    File: \boot\memtest.exe
    Status: 0xc000000f
    Info: the selected entry could not be loaded because the application is missing or corrupt.
    I can also use F8 on startup to get into the advanced boot options but selecting any of them simply results in the F3-F100-0003 error message.  I’ve run a memory test using the UBCD, which tells me the memory is fine, and tried another hard drive (which also works perfectly well in another laptop) but no joy.  On phoning Toshiba support the techie said my hard drive had failed, but as I say, both hard drives are perfectly fine / usable when hooked up to another laptop.  I’m now completely stuck as to what the problem is and how I might resolve it – any advice / suggestions would be most gratefully received! Thank you in advance :-)

    Satellite L655-S5096
    Downloads here.
    the second disc gives me the the "cannot read from source file or disk PREINST8.SWM"
    My best guess is that the disc is not readable. Try copying it to another. Sometimes that works.
    Otherwise, order new discs from Toshiba.
    -Jerry

  • Robo HTML 9 will not open our project from Source Control after initial start.

    We have a project in version control that we have been using forever, since 2003 or so and many versions of RH.  Now that we have upgraded to 9, this project will open the first time in version control and work normally.  Once you close the project and attempt to reopen from the starter screen, it opens just great, just not in version control.  The files are still set to read only.  I have done this several times and the only way i can work on my project in version control is to act like i am opening a project from scratch, then it needs to overwrite all of my local files with the server files.  It would not be so bad but I am 3000 miles away from the server and 13 hops plus a slow firewall on the other end.  While this has never been a problem in the past it is a big problem because it takes hours for all the files to download and overwrite my local files.
    This only happens with RH9 and Version Control 3.1.  RH8 works no problem.  So, I don't know if this is a RH9 starter problem or a Source Control Problem.  Maybe I will make a similar thread in the RH area.  I'll wait to see if I get any useful hits from this one first.
    It is very strange, I had RH9 open for several days because I was afraid to close the project for this reason and yesterday I published for the month so the heat is less right now but today, it opened with no source control.  If I go to Source Control the only thing i can select is put project in source control.  That is how it got into source control after converting to RH9.
    We have another project that seems to open from version control normally but we can only save topics in HTML view.  No useful answers to that topic after a week.
    Got any ideas???
    I have tried different folder names, different paths, etc.
    Thanks,
    dv

    Ok, here is a wierd one, I used the add to version control icon in the menu bar, It already knew the path so I figured I'm the only one who has been editing these files for the past few days so I clicked add to version control.  It added it. I closed and reopeded and still had the same files checked out.  Closed, checked in all, then reopened and it is working in SourceControl.  Strange that after opening from source control and closing that you need to reopen and tell it to put the project into source control.  Obviously some flag is not getting set somewhere.  This might help others having problems reopening source control files.
    dv

Maybe you are looking for