MINUS operation with remote table

Hi all,
Please help me with this problem.
I have two tables with 20 columns each, one table resides on one database and the other table is accesed through a db link. Both tables contains +800,000 records.
I need to know the record differences between these two tables - this is a periodical process, not for once- , I am using a MINUS operation with full scan, the problem is that my query is taking long time to finish : +20 min. Also i tried witn COLUMN IN() instead MINUS but my query performance is worst.
Do you know another way to get the record differences with a better performance?
Thanks in advance
Edited by: Osymad on Jun 18, 2012 5:12 PM

Osymad wrote:
Hi all,
Please help me with this problem.
I have two tables with 20 columns each, one table resides on one database and the other table is accesed through a db link. Both tables contains +800,000 records.
I need to know the record differences between these two tables - this is a periodical process, not for once- , I am using a MINUS operation with full scan, the problem is that my query is taking long time to finish : +20 min. Also i tried witn COLUMN IN() instead MINUS but my query performance is worst.
Do you know another way to get the record differences with a better performance?
Thanks in advance
Edited by: Osymad on Jun 18, 2012 5:12 PMhttp://www.oracle.com/technetwork/issue-archive/2005/05-jan/o15asktom-084959.html
Search for "Comparing the Contents of Two Tables"
Cheers,

Similar Messages

  • How can I bind a operation with a table

    Hi !
    I'm trying to bind a operation with a table, so what type of operation return ? ViewObject or a Vector? And how can i set params to these operation if my operation has some param ( getSubscriber(int iSubId, int iSubType) )
    Thank a lot for your help

    Hi,
    it depends on the release you are asking this question for. In JDeveloper 10.1.3 you can expose a method (e.g. on a session facade) that returns a Collection. The input parameters can be dragged and dropped as input fields to the page.
    The same can be done in JDeveloper 10.1.2, but here you have to prgrammatically apply the input arguments.
    Frank

  • 9iR2 : FORALL UPDATE is not working with remote table

    Hi,
    I am trying to use BULK COLLECT & FORALL to get records from a remote table (using Dblink) and insert the copy of the data locally and update the remote table to mark the record being processed. FORALL is working well with local tables but with not remote table. Am I missing some thing here interms of permissions or it would n't work that way?
    Thanks
    Sara

    Hello,
    I have the exact same question. I understand I cannot use FORALL with a database link, but what is the best alternative?
    The removte databases are on ships and the bandwidth is very narrow. I need to bulk collect about 8000 records a day; update the loacal database; and then update the remote (ship) database that I have taken these records.
    I can use the database link in a classic cursor FOR loop, but with the narrow bandwidtch it takes hours.
    Short of writing a file on the local server, ftp'ing it to the remote server any suggestions? Would Advanced Queuing be appropriate here?
    Gary

  • Expression operator with different tables....

    Hello All,
    I am facing this problem that I have this if condition that has an expression inside it where the expression id composed out of 4 columns in 4 different tables where these tables can not be joined because there is no logical join between them. The if statement goes as follows:
    if column1.table1 is equal to 0
    then equate column1.table2 to column1.table3 and put in column1.table4(which is a new column to be created)
    else if column1.table1 is equal to 1
    then subtract column1.table2 and column1.table3 and put in column1.table4(another new column)
    end if
    end if
    Note that the operator being used in order to have the conditional statement is the splitter operator. So my problem can be concluded in how can I have an expression that is composed out multiple column from different tables. Noting that if this is done a message saying you either need to join the tables or use a set operation and I can't do either since the data that would be outputted would be irrelevant.....
    Regards,
    Hossam

    Hi Hossam,
    the attributes of the input group of an expression operator must come from one outgroup (of a table for example).
    If you want to use columns from different tables in one expression operator, you must join them first. There is no way around it.
    Try to build a complete SQL query of what you want to do. Then rebuild this query in owb.
    As a rule of thumb: what cannot be done in SQL cannot be done in owb (since owb generates sql).
    Regards,
    Carsten.

  • Date operations with internal table

    Dear friends
               would you like to tell me. how i determine the most recent date and time from internal table i am not supposed to sort the table by date and time... I must check date and time with other records date and time to determine which record is most recently changed...
    here the scenario is.
    id       idnumber  chdate      chtime
    1        123456    20060606    135312
    2        123456    20060606    135900
    3        123456    20060606    132300
    4        123457    20060606    140000
    5        123457    20060606    142500
    in the above scenario i must keep in my mind that the most recently changed record is identical to its idnumber i can say that:
    the record should be fetched this way
    id       idnumber  chdate      chtime
    3        123456    20060606    132300
    5        123457    20060606    142500
    because here the id 3 is the most recently changed in the idnumber 123456
    where id 5 is the most recently changed in the idnumber 123457
    please help me to determin how i am supposed to carry out this task  any suggestion, code will be great help of mine.
    regards
    Naim

    Hi Naim,
      For example if ur select statement is like this..
       select id idnumber chdate chtime from xtable into table itab  where ...<condn>..
        sort itab by  idnumber chdate chtime  descending.
         delete adjacent duplicates from itab comparing idnumber .
         Code like above statement..
       You can get result...
    id idnumber chdate chtime
    3 123456 20060606 132300
    5 123457 20060606 142500
      Reward the points if it helps.

  • Finding duplicates:Minus set operator in dealing with internal tables

    Dear experts,
    I am newbie to ABAP developement,i have been given an assignment to find the duplicate list of vendors in lfa table.
    Now duplicate list doesnot means that text tokens will be just exact to conclude them as duplicate ,it could also be like
    1111 Vendor ABC
    1222 ABC Vendor
    If anybody has clue ,how to work on such a problem ,plz come forward.
    Right now i just tried initially how to find exact duplicates,i found  on change command,it do works.
    Then i am trying a new way which should just do the same thing.
    I did as per this algorithm
    1.Compute wholesome list in one internal table itab1
    2.Used delete adjacent duplicates in itab2.
    3.I feel itab3=itab1-itab2 will contain all duplicates in itab3.
    Can anyone give me a hint.How can i do A-B ?.

    Hi Arul,
    There is no special aided SET operations upon internal tables in ABAP. Concerning your particular task I would say that you can try INSERT statement for each record in your internal table without preliminary comparing them with DB table. If there is a record in DB table with the same key then sy-subrc after INSERT will be non zero (actually 4) and no real insert would occur. So, only those records would be inserted which have no counterpart in DB table.
    Best regards, Sergei

  • Minus operations on table

    Hi everyone,
    I am trying to find a way to do minus operations on table. I know this is possible in SQL, but I have yet to find out how to do it in ABAP. Can anyone help?
    What I need to do is the following.
    Let table A = (A,B,C,D,E) and table B = (B,C,E), then A minus B would return (A,D). Is there a function in ABAP for this?
    Thank you very much in advance.
    Philip R. Jarnhus

    hello,
    u can use subqueries:
    http://help.sap.com/saphelp_NW04/helpdata/en/dc/dc7614099b11d295320000e8353423/content.htm
    it is easy, but wrong way to solve your problem. This select will make a lot of calls to your DB.
    better way:
    1) two selects from table 1 and table 2 into two different internal tables.
    define two internal tables in your code. One table should have standard tables type and another hashed tables type with unique.
    2) subtract the result:
    loop at it_1 into ls_1.
      lv_tabix = sy-tabix.
      read table lt_1 transporting no fields with table key column_name =  ls_1-column_name.
    check sy-subrc eq 0.
      delete it_1 index lv_tabix.
    endloop.
    this solution will speed up your application.

  • Error in multiple operation with change document object for custom table

    hi all,
    I have developed a change document object for a custom table ZTEST and developed a report program for insertion, updation & deletion..everything works fine if I do only once ie. if I created only 1 entries. If I created 2 new entries , I am getting an Error "DUPREC:POS&Z3RL_TAB&Z3RL_TAB" and EXIT the transaction.
    why I am getting this error??? is it not possible to do multiple operation with the change document???
    kindly help.
    Edited by: JaiKarthik on Apr 7, 2010 6:20 AM

       LOOP AT ts_mod INTO wa_mod.
                READ TABLE <i_itab> INTO <wa_tab> INDEX wa_mod-row.
    * Select the existing entries in table Z3RL for change history
                    SELECT SINGLE * FROM z3rl
                           INTO wa_z3rl
                           WHERE vkorg   = <wa_tab>+3(4)
                           AND   zzkunnr = <wa_tab>+7(10).
    * Move the old entries
                    IF sy-subrc = 0.
                      CLEAR ls_z3rl.
                      ls_z3rl = wa_z3rl.
                    ENDIF.
    * Update the table
                 MODIFY (viewname) FROM <wa_tab>.
                   CLEAR wa_z3rl.
                    wa_z3rl-mandt      = <wa_tab>+0(3).
                    wa_z3rl-vkorg      = <wa_tab>+3(4).
                    wa_z3rl-zzkunnr    = <wa_tab>+7(10).
    * Populate change tables
                    CLEAR wa_change.
                    wa_change-teilobjid = 'Z3RL'.
                    wa_change-textart = 'TEST_2'.
                    wa_change-textspr = 'EN'.
                    wa_change-updkz = 'U'.
                    APPEND wa_change TO ts_change.
    *call the fM to log the values in CDHDR table.
                    CALL FUNCTION 'Z3RL_WRITE_DOCUMENT'
                      EXPORTING
                        objectid                 = 'Z3RL'
                        tcode                    = sy-tcode
                        utime                    = sy-uzeit
                        udate                    = sy-datum
                        username                 = sy-uname
                        planned_change_number    = ' '
                        object_change_indicator  = 'U'
                        planned_or_real_changes  = 'U'
                        no_change_pointers       = 'U'
                        upd_icdtxt_z3rl= 'U'
                        n_z3rl= wa_z3rl
                        o_z3rl        = ls_z3rl
                        upd_z3rl= 'U'
                        lv_opt                   = ' '
                      TABLES
                        icdtxt_z3rl= ts_change.
                CLEAR : wa_mod, <wa_tab>.
              ENDLOOP.
    Edited by: JaiKarthik on Apr 7, 2010 6:49 AM

  • Update openquery remote table with join

    Hi All,
    I have a problem with OPENQUERY update on remote table. I've googled for days, and can't solve the problem.
    Here is the problem:
    Local server MS SQL 2005.
    Remote server: MySQL.
    The linked server is communicating through MySQL ODBC 5.1
    I created the following code for update (tried many other version too, this is the last one):
    update openquery(Remoteserver,'select products_id, products_price, products_last_modified, products_stock from products1')
    set
    products_price=A.products_price,
    products_stock=A.products_stock,
    products_last_modified=getdate()
    FROM
    (select * from vi_products_update) AS A INNER JOIN
    openquery(octopus, 'select products_id from products1')AS B
    ON A.products_id=B.products_id
    When I run the query the columns are updated with the same value, for each record. It looks the value is the first which match the criteria. Each (remote and local) table has as primary key products_id. In this example I used as result set for local a view, but I have the same result if I use a table.
    the products_last_modified column is updated in order, and if I update for e.g. the products_price with a constant that is ok too. The problem should be somewhere with join, but I can' get it where.
    THX for any help
    ab

    Hi
    Did you ever solve this problem
    I have the same issue trying to update many rown in a MySQL table from SQL2005 using the syntax below,
    UPDATE
    openquery(DEV,'select id, `desc` from todLocationGroups')
    SET [desc] = V.Destination_Group FROM
    (select * from VTM_TOD_Rate) as V inner join
    openquery(DEV,'select id, `desc` from todLocationGroups') as K
    ON K.id = V.TOD_LG_ID
    but i get this error
    OLE DB provider "MSDASQL" for linked server "KAYOTE_DEV" returned message "Row cannot be located for updating. Some values may have been changed since it was last read.".
    Msg 7343, Level 16, State 4, Line 1
    The OLE DB provider "MSDASQL" for linked server "KAYOTE_DEV" could not UPDATE table "[MSDASQL]". The rowset was using optimistic concurrency and the value of a column has been changed after the containing row was last fetched or resynchronized.

  • Issue with query involving remote tables

    Hi I have a query inside a procedure that has 4 union all statements ,2 of which are based on tables at a remote database.
    The query is something like
    Select col1, col2, col3…..col n from Table_a, table_b, table c where join condition and certain hard-coded conditions based on run time parameters
    Union all
    Select col1, col2, col3…..col n from Table_a, table_b , table c where some join condition and certain hard-coded conditions based on run time parameters
    Union all
    Select col1, col2, col3…..col n from Table_a@remote_db, table_b@remote_db, table c@remote_db where join condition and certain hard-coded conditions based on run time parameters
    Union all
    Select col1, col2, col3…..col n from Table_a @remote_db, table_b @remote_db, table c@ remote_db where some join condition and certain hard-coded conditions based on run time parameters
    The join conditions on the tables are quite good and when executed individually bring data in good time.The queries on the remote database also run fine when I execute them in the remote database.
    However when I run this query, it doesn’t get data at all and after hours of running I have to cancel or kill it.I don’t get anything in the long-ops and in the wait class it just shows “SQL*Net message from dblink” or “SQL*Net more data to dblink”.
    I thought that there could be some latency issues AND the data retreival over the dblink could be slow, so I tried the /*+driving_site(rmote table alias)*/ hint , after which it comes up in the long ops as its reading from Table a/ table b from my current database but the wait time is something like millions of seconds and it runs forever.
    The issue is Table A and Table B both in the remote and the current database are huge tables with at least 40-50 million records in them.
    Can anyone suggest an easy way out in this scenario, other than the hard way of re-designing the entire program(which I am afraid I might have to in the end).
    Thanks

    @metzquar I Put the hint in the unions where I am accessing the remote tables
    @blushadow .. i was thinking about that but as these remote tables are in a sort of archived database, I dont think I will be allowed to create a mview.But thats a good suggestion.
    @Earth.. I tried that , but the table population itself gets very time consuming
    Thanks

  • Setting up a remote with ir-tables for use with XBMC

    My main goal is to use a remote with xbmc, but I'm having issues.
    Issue #1 (main problem): The directional keys and enter will work but no other keys seem to register.
    Issue #2: Even the keys that work have this weird usage issue, where pressing any of the same key twice loses the second key press. For example clicking up arrow 4 times results in only two actual "up's" being done. (first up works, second fails, third works, forth fails, etc)
    I've spent about four hours getting to this point and there is a lot of conflicting information out there on this subject which has had me very confused, but at this point I assume I can ignore any mention of Lirc as it seems like its not needed and if ir-keytable is used correctly things should just work?
    Quote from www.lirc.org: "Recent linux kernels make it possible to use some IR remote controls as regular input devices"
    What I have got/done:
    Machine: Zotac Zbox Nano AD10 with remote.
    Linux: Manjaro Openbox Addition
    Testing in applications: XBMC, Leafpad, Terminal
    [david@zotac ~]$ dmesg | grep CIR
    [    4.444693] ite_cir: Auto-detected model: ITE8704 CIR transceiver
    [    4.444701] ite_cir: Using model: ITE8704 CIR transceiver
    [    4.478490] input: ITE8704 CIR transceiver as /devices/virtual/rc/rc0/input8
    [    4.478531] rc0: ITE8704 CIR transceiver as /devices/virtual/rc/rc0
    [david@zotac ~]$ ir-keytable
    Found /sys/class/rc/rc0/ (/dev/input/event6) with:
            Driver ite-cir, table rc-rc6-mce
            Supported protocols: NEC RC-5 RC-6 JVC SONY SANYO LIRC other
            Enabled protocols: NEC RC-5 RC-6 JVC SONY SANYO LIRC other
            Name: ITE8704 CIR transceiver
            bus: 25, vendor/product: 1283:0000, version: 0x0000
            Repeat delay = 500 ms, repeat period = 500 ms
    #My keymaps file contains (I just put the keys that I would like to use with xmbc)
    0x8034045b KEY_RIGHT
    0x8034045a KEY_LEFT
    0x8034045c KEY_ENTER
    0x80348459 KEY_DOWN
    0x80340458 KEY_UP
    0x80348421 KEY_R
    0x80340420 KEY_F
    0x80348410 KEY_EQUAL
    0x80348483 KEY_ESC
    0x80348431 KEY_X
    0x8034842f KEY_T
    0x803404cb KEY_I
    0x8034845d KEY_M
    0x8034042c KEY_P
    0x80340411 KEY_MINUS
    I write my keymaps file: (I think /etc/keymaps/[file] would be a better location for this file but it shouldn't matter is that correct?)
    ir-keytable -c -w /home/david/Documents/keymaps --device=/dev/input/event6 --period=500 --delay=500
    I can verify the settings are registered:
    [david@zotac ~]$ ir-keytable --read --device=/dev/input/event6
    scancode 0x80340411 = KEY_MINUS (0x0c)
    scancode 0x80340420 = KEY_F (0x21)
    scancode 0x8034042c = KEY_P (0x19)
    scancode 0x80340458 = KEY_UP (0x67)
    scancode 0x8034045a = KEY_LEFT (0x69)
    scancode 0x8034045b = KEY_RIGHT (0x6a)
    scancode 0x8034045c = KEY_ENTER (0x1c)
    scancode 0x803404cb = KEY_I (0x17)
    scancode 0x80348410 = KEY_EQUAL (0x0d)
    scancode 0x80348421 = KEY_R (0x13)
    scancode 0x8034842f = KEY_T (0x14)
    scancode 0x80348431 = KEY_X (0x2d)
    scancode 0x80348459 = KEY_DOWN (0x6c)
    scancode 0x8034845d = KEY_M (0x32)
    scancode 0x80348483 = KEY_ESC (0x01)
    At this point is seems like everything is setup correctly but like I said only the direction keys and return work. If it did work my next step would be determining when to issue the ir-keytable write, and I'm assuming I can just do that in openbox's autostart file?
    Does anyone have any ideas as to what I might do to correct these issues?

    I also encountered davevallance's issue #1.  Directional and enter keys already work, as do volume keys.  If any other button is mapped to those working keys (using ir-keytable) then they also work, for example I can successfully map the useless "teletext" to "enter" and it produces a linefeed when pressed but I cannot get it to do the same with "space".  Interestingly it does produce a space keypress in a virtual terminal (Ctrl+Alt+F3), also "ir-keytable -t" shows the correct key event which proves the underlying OS is recognising the mapping.  The issue is somewhere in the X system instead.
    I refer now to HID Remotes which covers the situation well.  It explains that X does not process keycodes above 255 and at first that would seem to fit here.  All the keys which work (arrows, enter, volume) have keycodes less than 255.  So why don't other 'safe' keycodes work too?
    Xorg has it's own keycode map with "xmodmap" but I don't think that is responsible in this case.  From the Arch wiki it suggests exploring with:
    xev | grep -A2 --line-buffered '^KeyRelease' | sed -n '/keycode /s/^.*keycode \([0-9]*\).* (.*, \(.*\)).*$/\1 \2/p'
    Unmapped keys should produce a "NoSymbol" message but for my non-working keys there is no response at all in X.  Is there another layer between kernal and GUI?

  • Need some help with the Table Function Operator

    I'm on OWB 10gR2 for Sun/Solaris 10 going against some 10gR2 DB's...
    I've been searching up and down trying to figure out how to make OWB use a Table Function (TF) which will JOIN with another table; allowing a column of the joined table to be a parameter in to the TF. I can't seem to get it to work. I'm able to get this to work in regular SQL, though. Here's the setup:
    -- Source Table:
    DROP TABLE "ZZZ_ROOM_MASTER_EX";
    CREATE TABLE "ZZZ_ROOM_MASTER_EX"
    ( "ID" NUMBER(8,0),
    "ROOM_NUMBER" VARCHAR2(200),
    "FEATURES" VARCHAR2(4000)
    -- Example Data:
    Insert into ZZZ_ROOM_MASTER_EX (ID,ROOM_NUMBER,FEATURES) values (1,'Room 1',null);
    Insert into ZZZ_ROOM_MASTER_EX (ID,ROOM_NUMBER,FEATURES) values (2,'Room 2',null);
    Insert into ZZZ_ROOM_MASTER_EX (ID,ROOM_NUMBER,FEATURES) values (3,'Room 3','1,1;2,3;');
    Insert into ZZZ_ROOM_MASTER_EX (ID,ROOM_NUMBER,FEATURES) values (4,'Room 4','5,2;5,4;');
    Insert into ZZZ_ROOM_MASTER_EX (ID,ROOM_NUMBER,FEATURES) values (5,'Room 5',' ');
    -- Destination Table:
    DROP TABLE "ZZZ_ROOM_FEATURES_EX";
    CREATE TABLE "ZZZ_ROOM_FEATURES_EX"
    ( "ROOM_NUMBER" VARCHAR2(200),
    "FEATUREID" NUMBER(8,0),
    "QUANTITY" NUMBER(8,0)
    -- Types for output table:
    CREATE OR REPLACE TYPE FK_Row_EX AS OBJECT
    ID NUMBER(8,0),
    QUANTITY NUMBER(8,0)
    CREATE OR REPLACE TYPE FK_Table_EX AS TABLE OF FK_Row_EX;
    -- Package Dec:
    CREATE OR REPLACE
    PACKAGE ZZZ_SANDBOX_EX IS
    FUNCTION UNFK(inputString VARCHAR2) RETURN FK_Table_EX;
    END ZZZ_SANDBOX_EX;
    -- Package Body:
    CREATE OR REPLACE
    PACKAGE BODY ZZZ_SANDBOX_EX IS
    FUNCTION UNFK(inputString VARCHAR2) RETURN FK_Table_EX
    AS
    RETURN_VALUE FK_Table_EX := FK_Table_EX();
    i NUMBER(8,0) := 0;
    BEGIN
    -- TODO: Put some real code in here that will actually read the
    -- input string, parse it out, and put data in to RETURN_VALUE
    WHILE(i < 3) LOOP
    RETURN_VALUE.EXTEND;
    RETURN_VALUE(RETURN_VALUE.LAST) := FK_Row_EX(4, 5);
    i := i + 1;
    END LOOP;
    RETURN RETURN_VALUE;
    END UNFK;
    END ZZZ_SANDBOX_EX;
    I've got a source system built by lazy DBA's and app developers who decided to store foreign keys for many-to-many relationships as delimited structures in driving tables. I need to build a generic table function to parse this data and return it as an actual table. In my example code, I don't actually have the parsing part written yet (I need to see how many different formats the source system uses first) so I just threw in some stub code to generate a few rows of 4's and 5's to return.
    I can get the data from my source table to my destination table using the following SQL statement:
    -- from source table joined with table function
    INSERT INTO ZZZ_ROOM_FEATURES_EX(
    ROOM_NUMBER,
    FEATUREID,
    QUANTITY)
    SELECT
    ZZZ_ROOM_MASTER_EX.ROOM_NUMBER,
    UNFK.ID,
    UNFK.QUANTITY
    FROM
    ZZZ_ROOM_MASTER_EX,
    TABLE(ZZZ_SANDBOX_EX.UNFK(ZZZ_ROOM_MASTER_EX.FEATURES)) UNFK
    Now, the big question is--how do I do this from OWB? I've tried several different variations of my function and settings in OWB to see if I can build a single SELECT statement which joins a regular table with a table function--but none of them seem to work, I end up getting SQL generated that won't compile because it doesn't see the source table right:
    INSERT
    /*+ APPEND PARALLEL("ZZZ_ROOM_FEATURES_EX") */
    INTO
    "ZZZ_ROOM_FEATURES_EX"
    ("ROOM_NUMBER",
    "FEATUREID",
    "QUANTITY")
    (SELECT
    "ZZZ_ROOM_MASTER_EX"."ROOM_NUMBER" "ROOM_NUMBER",
    "INGRP2"."ID" "ID_1",
    "INGRP2"."QUANTITY" "QUANTITY"
    FROM
    (SELECT
    "UNFK"."ID" "ID",
    "UNFK"."QUANTITY" "QUANTITY"
    FROM
    TABLE ( "ZZZ_SANDBOX_EX"."UNFK2" ("ZZZ_ROOM_MASTER_EX"."FEATURES")) "UNFK") "INGRP2",
    "ZZZ_ROOM_MASTER_EX" "ZZZ_ROOM_MASTER_EX"
    As you can see, it's trying to create a sub-query in the FROM clause--causing it to just ask for "ZZZ_ROOM_MASTER_EX"."FEATURES" as an input--which isn't available because it's outside of the sub-query!
    Is this some kind of bug with the code generator or am I doing something seriously wrong here? Any help will be greatly appreciated!

    Hello Everybody!
    Thank you for all your response!
    I had changes this work area into Internal table and changed the select query. PLease let me know if this causes any performance issues?
    I had created a Z table with the following fields :
    ZADS :
    MANDT
    VKORG
    ABGRU.
    I had written a select query as below :
    I had removed the select single and insted of using the Structure it_rej, I had changed it into Internal table 
    select vkorg abgru from ZADS into it_rej.
    Earlier :
    IT_REJ is a Work area:
    DATA : BEGIN OF IT_REJ,
    VKORG TYPE VBAK-VKORG,
    ABGRU TYPE VBAP-ABGRU,
    END OF IT_REJ.
    Now :
    DATA : BEGIN OF IT_REJ occurs 0,
    VKORG TYPE VBAK-VKORG,
    ABGRU TYPE VBAP-ABGRU,
    END OF IT_REJ.
    I guess this will fix the issue correct?
    PLease suggest!
    Regards,
    Developer.

  • Insertion into local table from remote table with contains clause

    Hi all,
    We are tasked to insert some rows into our database from another database. We tried to use DBLinks to link the 2 databases and were able to use Select statements to filter out the data that we need to insert into our database.
    These statements take the form of: Select * from RemoteTable where contains@RemoteLink(IndexColumn, 'car')>0;
    where RemoteLink is the DBLink that we have created.
    However Oracle gave us an error (ORA-00949: illegal reference to remote table) when we tried to insert the dataset from the above statement into our local table. We used the following statement in doing so: Insert Into LocalTable (Select * from RemoteTable where contains@RemoteLink(IndexColumn, 'car')>0);
    Even if we use Create Table, Oracle gave us the same error when we tried to push the data from the Select Statement into the new table.
    Could anyone advise us whether it is possible to insert such data into a local table? And if som what is the proper way of doing it?
    Many thanks to any advises.

    Hi,
    there is document 261741.1 on Metalink. This states explicitly that it is not possible to invoke remote user-defined operators, and contains is such. The solution given in the article is to create a wrapper function on the remote site and this one calling in stead of contains.
    Herald ten Dam
    htendam.wordpress.com

  • 20 Index Restriction on Remote Tables (i.e. using Database Links)

    The Oracle Database Administrator's Guides for 10g and 11g document a performance restriction that "No more than 20 indexes are considered for a remote table." If I go back to the 8i documentation it says "In cost-based optimization, no more than 20 indexes per remote table are considered when generating query plans. The order of the indexes varies; if the 20-index limitation is exceeded, random variation in query plans may result."
    Does anyone have more details on this performance restriction? In particular I am trying to answer these questions:
    1) Are the 20 indexes which are considered by the CBO still random in 10g?
    2) Can I influence which indexes are considered with index hints or will my hints only be considered if they are for one of the "random" 20 indexes which are being considered by the CBO?
    3) Are there any other approaches or work-arounds to this restriction assuming you need to select from a large remote table with more than 20 indexes (and need to perform the selection using 1 of those indexes to get adequate performance) or do we need to abandon database links for this table?
    Thanks in advance for your input.

    So, here's my simple test.
    SQL>
    SQL> create table gurnish.indexes20plus ( n1 number, n2 number, n3 number, n4 number, n5 number, n6 number, n7 number,
    2 n8 number, n9 number, n10 number, n11 number, n12 number, n13 number, n14 number, n15 number, n16 number,
    3 n17 number, n18 number, n19 number, n20 number, n21 number, n22 number, n23 number, n24 number,
    4 n25 number, n26 number, n28 number);
    create index xin1 on indexes20plus (n1);
    Table created.
    SQL> SQL> create index xin2 on indexes20plus (n2);
    create index xin3 on indexes20plus (n3);
    Index created.
    SQL> SQL>
    Index created.
    SQL> SQL> create index xin4 on indexes20plus (n4);
    Index created.
    SQL> SQL>
    Index created.
    SQL> SQL> create index xin5 on indexes20plus (n5);
    create index xin6 on indexes20plus (n6);
    Index created.
    SQL> SQL>
    Index created.
    SQL> SQL> create index xin7 on indexes20plus (n7);
    Index created.
    SQL> SQL> create index xin8 on indexes20plus (n8);
    Index created.
    SQL> SQL> create index xin9 on indexes20plus (n9);
    Index created.
    SQL>
    SQL> create index xin10 on indexes20plus (n10);
    Index created.
    SQL> SQL> create index xin11 on indexes20plus (n11);
    create index xin12 on indexes20plus (n12);
    create index xin13 on indexes20plus (n13);
    Index created.
    SQL> SQL>
    Index created.
    SQL> SQL>
    Index created.
    SQL> SQL> create index xin14 on indexes20plus (n14);
    Index created.
    SQL> SQL> create index xin15 on indexes20plus (n15);
    Index created.
    SQL>
    SQL> create index xin16 on indexes20plus (n16);
    Index created.
    SQL>
    SQL> create index xin17 on indexes20plus (n17);
    Index created.
    SQL> SQL> create index xin18 on indexes20plus (n18);
    Index created.
    SQL> SQL> create index xin19 on indexes20plus (n19);
    Index created.
    SQL> SQL> create index xin20 on indexes20plus (n20);
    Index created.
    SQL> SQL> create index xin21 on indexes20plus (n21);
    Index created.
    declare
    i number;
    begin
    for i in 1..100
    loop
    dbms_random.seed(i+100);
    insert into indexes20plus values (dbms_random.value(1,5),dbms_random.value(1,21),dbms_random.RANDOM, dbms_random.RANDOM,dbms_random.value(1,20),
    dbms_random.value(1,4),dbms_random.value(1,6), dbms_random.value(1,7),dbms_random.value(1,9),dbms_random.value(1,10),
    dbms_random.value(1,11),dbms_random.value(1,12),dbms_random.value(1,13),dbms_random.value(1,14),dbms_random.value(1,1),
    dbms_random.value(1,1),dbms_random.value(1,19),dbms_random.value(1,122),dbms_random.value(1,20),dbms_random.value(1,20)
    ,dbms_random.value(4,20),dbms_random.value(1,20),dbms_random.value(1,20),dbms_random.value(1,20),dbms_random.value(1,20)
    ,dbms_random.value(4,20),dbms_random.value(4,20));
    end loop;
    commit;
    end;
    SQL> set autotrace traceonly
    SQL> l
    1* select * from gurnish.indexes20plus@lvoprds where n1 = 4
    SQL> /
    no rows selected
    Execution Plan
    Plan hash value: 441368878
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU
    )| Time | Inst |
    | 0 | SELECT STATEMENT REMOTE | | 1 | 351 | 1 (0
    )| 00:00:01 | |
    | 1 | TABLE ACCESS BY INDEX ROWID| INDEXES20PLUS | 1 | 351 | 1 (0
    )| 00:00:01 | LVPRD |
    |* 2 | INDEX RANGE SCAN | XIN1 | 1 | | 1 (0
    )| 00:00:01 | LVPRD |
    Predicate Information (identified by operation id):
    2 - access("A1"."N1"=4)
    Note
    - fully remote statement
    - dynamic sampling used for this statement
    Statistics
    0 recursive calls
    0 db block gets
    0 consistent gets
    0 physical reads
    0 redo size
    1897 bytes sent via SQL*Net to client
    481 bytes received via SQL*Net from client
    1 SQL*Net roundtrips to/from client
    0 sorts (memory)
    0 sorts (disk)
    0 rows processed
    SQL> select * from gurnish.indexes20plus@lvoprds where n21 = 4;
    no rows selected
    Execution Plan
    Plan hash value: 2929530649
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU
    )| Time | Inst |
    | 0 | SELECT STATEMENT REMOTE | | 1 | 351 | 1 (0
    )| 00:00:01 | |
    | 1 | TABLE ACCESS BY INDEX ROWID| INDEXES20PLUS | 1 | 351 | 1 (0
    )| 00:00:01 | LVPRD |
    |* 2 | INDEX RANGE SCAN | XIN21 | 1 | | 1 (0
    )| 00:00:01 | LVPRD |
    Predicate Information (identified by operation id):
    2 - access("A1"."N21"=4)
    Note
    - fully remote statement
    - dynamic sampling used for this statement
    Statistics
    1 recursive calls
    0 db block gets
    0 consistent gets
    0 physical reads
    0 redo size
    1897 bytes sent via SQL*Net to client
    481 bytes received via SQL*Net from client
    1 SQL*Net roundtrips to/from client
    0 sorts (memory)
    0 sorts (disk)
    0 rows processed
    SQL>

  • How to load XML data to remote table?

    I have a table in our DEV instance with XMLTYPE data in it:
    TB_PAGE_DATA
    ( PAGEID INTEGER,
    PAGENAME VARCHAR2(250) NOT NULL,
    PAGECONTENT SYS.XMLTYPE,
    CREATEDATE DATE NOT NULL,
    UPDATEDATE DATE
    )The same table exists in PROD, but it is currently empty. I want to load it with all the records from DEV, but apparently I can't do this via DB Link since I get an error:
    INSERT INTO tb_page_data@prod_link
    (select *
    from tb_page_data)
    ORA-22804: remote operations not permitted on object tables or user-defined type columns

    Performing DML utilizing a remote table with XMLTYPE seems to be the issue, so I"m not sure if this would work also. In any case, the PROD instance does not have a link going back to the DEV instance. I cannot create this link.

Maybe you are looking for

  • Moving a 32 bit Oracle 9i database to 64 bit on a different server

    Hello, We have a 24 GB database with Oracle 9.2.0.7 (32 bit). As the hardware of this server is getting obsolete, it is planned to move this instance to another server, which has 64 bit Oracle software of same version (9.2.0.7). In this scenario what

  • Sending dial up connection to a wired base station?

    Hi have a powerbook G4 Ti with airport card, an extreme base station and an emac with a dial up connection. I was wondering if anybody knows how I can route the dial up connection via ethernet to the base station so I can get the dial up connetion th

  • Migrate from Macbook Pro to Macbook Pro

    I have an existing Macbook w/ 120Gb HD.  Always running out of space.  Picked up a slightly used Macbook Pro w/ 500 Gb HD and I want to migrate to the new machine.  Does anyone know of the best procedure to follow.  I have my existing Macbook backed

  • Where we can upload our widget on mac

    where we can upload our widget on mac to see it in apple widget downloads?

  • HP psc1315xi does not seem to be recognized by software

    When I attempt to scan a paper, and hit hp, then HP Solution Center, a message pops up that states "no device detected, HP Solution Center will close."   Yet, when I print from a software, the printer does so. I have downloaded the latest software an