Optimizer (?) excluded table join

Hello

I have a problem. We use 10.2.0.5.0 database. I discovered very weird behavior when running a very simple three-table join. I tried two forms of the same join. The first was:

SELECT

NVL(c.cen_za_ks,1) as a2,

NVL(c.cen_za_kg,1) like a3

Of

vymenny_urad VIEW

JOIN IN-HOUSE

Krajina K ON vu.vymur_krj_id = K.KRJ_ID

JOIN IN-HOUSE

CENNIK_090 C ON C.CEN_KR_KOD = K.KRJ_KOD

WHERE

vu.vymur_id = AND c.cen_kategoria = 369 has '

Execution plan for this selection is:

-----------------------------------------------------------------------------------------

| ID | Operation | Name               | Lines | Bytes | Cost (% CPU). Time |

-----------------------------------------------------------------------------------------

|   0 | SELECT STATEMENT |                    |     4.    88.     5 (0) | 00:00:01 |

|   1.  NESTED LOOPS |                    |     4.    88.     5 (0) | 00:00:01 |

|*  2 |   INDEX UNIQUE SCAN | IX_PK_VYMENNY_URAD |     1.       |     1 (0) | 00:00:01 |

|*  3 |   TABLE ACCESS FULL | CENNIK_090 |     4.    56.     3 (0) | 00:00:01 |

-----------------------------------------------------------------------------------------

Information descriptor (identified by the operation identity card):

---------------------------------------------------

2 - access("VU".") VYMUR_ID "= 369)

3 - filter("C".") CEN_KATEGORIA "(='D')"


Thus, for specific settings, I had 8 rows


If I added any column of krajina of table columns selected like this:


SELECT

krj_id,

NVL(c.cen_za_ks,1) as a2,

NVL(c.cen_za_kg,1) like a3

Of

vymenny_urad VIEW

JOIN IN-HOUSE

Krajina K ON vu.vymur_krj_id = K.KRJ_ID

JOIN IN-HOUSE

CENNIK_090 C ON C.CEN_KR_KOD = K.KRJ_KOD

WHERE

vu.vymur_id = AND c.cen_kategoria = 369 has '


the execution plan has been changed to:


----------------------------------------------------------------------------------------------------

| ID | Operation | Name               | Lines | Bytes | Cost (% CPU). Time |

----------------------------------------------------------------------------------------------------

|   0 | SELECT STATEMENT |                    |     1.    29.     6 (0). 00:00:01 |

|   1.  NESTED LOOPS |                    |     1.    29.     6 (0). 00:00:01 |

|   2.   NESTED LOOPS |                    |     1.    15.     3 (0) | 00:00:01 |

|*  3 |    TABLE ACCESS BY INDEX ROWID | VYMENNY_URAD |     1.     8.     2 (0) | 00:00:01 |

|*  4 |     INDEX UNIQUE SCAN | IX_PK_VYMENNY_URAD |     1.       |     1 (0) | 00:00:01 |

|   5.    TABLE ACCESS BY INDEX ROWID | KRAJINA |   244.  1708.     1 (0) | 00:00:01 |

|*  6 |     INDEX UNIQUE SCAN | PK_KRAJINA |     1.       |     0 (0) | 00:00:01 |

|*  7 |   TABLE ACCESS FULL | CENNIK_090 |     1.    14.     3 (0) | 00:00:01 |

----------------------------------------------------------------------------------------------------

Information of predicates (identified by the operation identity card):

---------------------------------------------------

3 - filter("VU".") VYMUR_KRJ_ID"< 2147483648)

4 - access("VU".") VYMUR_ID "= 369)

6 - access("VU".") VYMUR_KRJ_ID '=' K '. ("' KRJ_ID")

7 - filter("C".") CEN_KATEGORIA "= A"AND "C". ". CEN_KR_KOD '=' K '. ("' KRJ_KOD")

and result set had only 2 rows, because of the restriction imposed by the table "krajina", which was not in the first case considered by the optimizer.

Y at - it a reasonable explanation for this behavior? Have someone at - he found a reliable solution?

Thanks for help

Miro

I received your email

I saw something strange in the, but then realize that the elimination was logically invalid and created a simple demo.

If you look at the two surviving tables SEPARATELY it seems reasonable to eliminate the krajina - but when you look at the other two tables at the same time you realize that you have a line in krajina which corresponds to a line in vymenny_urad but not in cennik_090 and a line that does the opposite. In this case, the other two lines survive when you eliminate the krajina, but they disappear if krajina is located in the middle of the join.

The problem is solved by 11.1.0.7

Concerning

Jonathan Lewis

Tags: Database

Similar Questions

  • table join question

    I have two tables joined via a pk/fk relationship. The main table has a field that indicates if a person entered the House (that's a request for home detention for minors) and to the left, or if it is still in the House.

    1 = entered and left, 0 = always in the House.

    The two tables are related through three fields (ID of the person, House ID, date of entry in the House)

    I need a query to retrieve the records that exist in table 1 (the master) but do not exist in table 2 (retail) for (young) people who are STILL in the House. I need the query to run on the House n ° 2.

    I tried a number of relationships to join, but none has been successful.

    Any ideas on how to write this request will be appreciated.

    The next time after table descriptions...

    I think you're asking something like that:

    select pt.*
    from parent_table pt
    where pt.field = 0
      and pt.home = 2
      and not exists
      (select 'a child row for this parent row'
       from child_table ct
       where ct.person = pt.person
         and ct.home = pt.home
         and ct.entry_date = pt.entry_date);
    
  • Several 2-table join

    Hello

    I'm trying to join 4 tables in one column and I would return starting with the select statement.

    Tables-> e_sehir

    -> e_pano

    -> e_haberlesme_unitesi

    -> e_io_modulu


    common point

    e_sehir.ID -> e_pano.sehir_ID

    e_sehir.ID -> e_haberlesme_unitesi .sehir_ID

    e_sehir.ID -> e_io_modulu .sehir_ID


    I try to write code below but return of same value. Help me please

    -------------------------------------------------------------------------------------------------------------------

    / * Formatted on 10/11/2015 12:51:59 AM (PS5 v5.256.13226.35538) * /.

    SELECT S.name,

    COUNT (p.id),

    COUNT (hu.id),

    COUNT (io.id)

    Of e_pano p

    INNER JOIN e_sehir s ON P.IL_ID = s.ID

    INNER JOIN e_haberlesme_unitesi hu ON s.ID = HU. IL_ID

    INNER JOIN e_io_modulu io ON s.ID is IO. IL_ID

    GROUP BY (s.name);

    On my phone, so excuse the formatting.

    In general, I do not count indictment join if I select this table, I use where exists, which may force the optimizer to use loops nested with short circuit. The optimizer will always prefer the concatenation (optimizer speak for union all) in the resolution of the data set, but there are always dependencies on the data and indexes, in any case, I would expect something as below can be quite fast:

    Select sum (pcount) as pcount, sum (hcount) as hcount, sum (ecount) as ecount

    de)

    Select pcount County (p.id), to_number (null) hcount, to_number (null) ecount,

    of e_pano p

    where exists (select null

    of s e_sehir

    where s.id = p.il_id)

    Union of all the

    Select the value null, count (hu.id), null

    of e_haberlesme_unitesi hu

    where exists (select null

    s e_sehir

    where s.id = hu.il_id

    Union of all the

    Select null, null, count (io.id)

    of e_io_modulu io

    where exists (select null

    of s e_sehir

    where s.id = io.il_id)

    )

  • Left join with three-table join query

    I am trying to create a query that left me speechless. Most of the query is simple enough, but I have a problem I do not know how to solve.

    Background:
    We have stock stored in i_action.

    We have the attributes available for each type of action. The attributes available for each action are described in shared_action_attribute. Each type of action can have three attributes or none at all.

    We have the values stored for the attributes in i_attribute_value.

    An example says:
    We have a transfer action (action_code B4). The action of B4 entry into i_action records the fact that the transfer took place and the date at which he spoke. The attributes available for a transfer action are the function code receiver, the receiving unit number and the reason of transfer code. These types of attributes available and their order are stored in shared_action_attribute. The actual values of the attributes for a specific action of transfer are stored in i_attribute_value.

    Now i_action and i_attribute_value can be connected directly in action_seq in i_action and ia_action_seq in i_attribute_value. A left join on these two tables provides results for all actions (including actions that have no attributes) and assign values (see Query 1 below).

    There are two questions. First of all, I want only the first two attributes. To specify the attributes of the first two, I also i_attribute_value a link to shared_action_attribute (which is where the order is stored). I can build a simple query (without the left join) which connects the three tables, but then shares without attributes would be excluded from my result (see Query 2 below).

    The second problem is that I'd actually a row returned for each action with first_attribute and second_attribute in the form of columns instead of two lines.

    The final query will be used to create a materialized view.

    Here are the tables and examples of what is stored in the:

    TABLE i_action
    Name Type
    ----
    ACTION_SEQ NUMBER (10)
    DATE OF ACTION_DATE
    ACTION_CODE VARCHAR2 (3)
    VARCHAR2 (1) DELETED

    EXAMPLE OF LINES
    ACTION_SEQ ACTION_DATE DELETED ACTION_CODE
    ----
    45765668 9 OCTOBER 09 B2 HAS
    45765670 9 OCTOBER 09 BA HAS
    45765672 B6 9 OCTOBER 09A
    45765673 9 OCTOBER 09 B4 HAS
    45765674 9 OCTOBER 09 G1 HAS
    45765675 9 OCTOBER 09 M3 HAS

    TABLE i_attribute_value
    Name Type
    ---
    IA_ACTION_SEQ NUMBER (10)
    SACTATT_SACT_CODE VARCHAR2 (3)
    SACTATT_SAT_TYPE VARCHAR2 (3)
    VARCHAR2 VALUE (50)

    EXAMPLE OF LINES
    IA_ACTION_SEQ SACTATT_SACT_CODE SACTATT_SAT_TYPE VALUE
    ----
    45765668 B2 COA 37 B
    45765670 BA ROA D
    45765670 BA ROR P
    45765672 B6 CAT C
    B4 45765673 RFC E
    45765673 B4 TRC P
    B4 45765673 RUN 7
    45765674 G1 SS 23567
    G1 45765674 ASG W

    TABLE shared_action_attribute
    Name Type
    ---
    SACT_CODE VARCHAR2 (3)
    SAT_TYPE VARCHAR2 (3)
    ORDER NUMBER (2)
    TITLE VARCHAR2 (60)

    EXAMPLE OF LINES
    SACT_CODE SAT_TYPE UNDER THE ORDER
    ----
    B2 ACO 1 Office code
    BA ROR 1 reason to re-open
    Authority of BA ROA 2 reopen
    B6 CAT 1 category
    B4 RFC 1 reception function code
    B4 RUN 2 receives the unit code
    B4 TRC 3 transfer of reason code
    Sequence of G1 SS 1 personal
    Reason for G1 ASG 2 assignment

    QUERY 1:
    It's my current query as well as its results. Most are select simple but only one column is filled using the function analytic last_value (thank you guys). The last column in the view sub stores the value of the attribute. What I want is to replace this single column with two columns named first_attribute and second_attribute and eliminate all other attributes.
    SELECT ia.action_seq, ia.action_date, ia.action_code cod,
    NVL
    (LAST_VALUE (CASE
    WHEN ia.action_code = "G1".
    AND iav.sactatt_sat_type = 'SS '.
    THEN THE VALUE
    WHEN ia.action_code IN ('A0', 'A1')
    THEN '67089'
    END IGNORE NULLS
    ) OVER (PARTITION BY ia.ici_charge_inquiry_seq ORDER BY ia.action_date,
    IA.serial_number, ia.action_seq),
    '67089'
    ) staff_seq,.
    value
    From i_action LEFT JOIN i_attribute_value iav AI
    ON iav.ia_action_seq = ia.action_seq
    WHERE ia.deleted = 'A ';

    ACTION_SEQ ACTION_DA COD STAFF_SEQ VALUE
    ----
    45765668 9 OCTOBER 09 B2 67089 37 B
    45765670 9 OCTOBER 09 BA D 67089
    45765670 9 OCTOBER 09 BA 67089 P
    45765672 9 OCTOBER 09 B6 67089 C
    45765673 9 OCTOBER 09 B4 67089 E
    45765673 9 OCTOBER 09 B4 67089 P
    45765673 9 OCTOBER 09 67089 7 B4
    45765674 9 OCTOBER 09 23567 23567 G1
    45765674 9 OCTOBER 09 G1 23567 W
    45765675 9 OCTOBER 09 M3 23567

    QUERY 2:
    This query is limited to the first two attributes but he also filed actions which have no attributes, and it creates still several lines for each action instead of a single line with two columns for attributes.
    SELECT ia.action_seq, ia.action_date, ia.action_code cod,
    NVL
    (LAST_VALUE (CASE
    WHEN ia.action_code = "G1".
    AND iav.sactatt_sat_type = 'SS '.
    THEN THE VALUE
    WHEN ia.action_code IN ('A0', 'A1')
    THEN '67089'
    END IGNORE NULLS
    ) OVER (PARTITION BY ia.ici_charge_inquiry_seq ORDER BY ia.action_date,
    IA.serial_number, ia.action_seq),
    '67089'
    ) staff_seq,.
    value
    OF shared_action_attribute saa, ims_action AI, ims_attribute_value iav
    WHERE iav.ia_action_seq = ia.action_seq
    AND iav.sactatt_sact_code = saa.sact_code
    AND iav.sactatt_sat_type = saa.sat_type
    AND saa.display_order IN ('1 ', ' 2')
    AND ia.deleted = 'A ';

    ACTION_SEQ ACTION_DA VALUE OF COD
    ----
    45765668 9 OCTOBER 09 B2 67089 37 B
    45765670 9 OCTOBER 09 BA D 67089
    45765670 9 OCTOBER 09 BA 67089 P
    45765672 9 OCTOBER 09 B6 67089 C
    45765673 9 OCTOBER 09 B4 67089 E
    45765673 9 OCTOBER 09 67089 7 B4
    45765674 9 OCTOBER 09 23567 23567 G1
    45765674 9 OCTOBER 09 G1 23567 W

    I found it quite complex to try to write - I hope that I was clear.

    Thank you very much!

    Hello

    You can use an alias for column (such as staff_seq) in the ORDER BY. Unfortunately, it's the only place where you can use it in the same query, where it was defined.
    You can use it anywhere in the super-requetes, however, so you can still work around this problem in assigning the aliases in a subquery and GROUP BY (or other) in a Super query, like this:

    WITH   ungrouped_data      AS
    (
        SELECT ia.action_seq, ia.action_date, ia.action_code,
              NVL
                  (LAST_VALUE (CASE
                                  WHEN ia.action_code = 'G1'
                                   AND sactatt_sat_type = 'SS'
                                     THEN VALUE
                                  WHEN ia.action_code IN ('A0', 'A1')
                                     THEN '67089'
                               END IGNORE NULLS
                              ) OVER (PARTITION BY ia.ici_charge_inquiry_seq ORDER BY ia.action_date, ia.action_seq),
                   '67089'
                  )staff_seq,
               (CASE
                  WHEN display_order = '1'
                  THEN VALUE
               END) first_attribute,
               (CASE
                  WHEN display_order = '2'
                  THEN VALUE
               END) second_attribute
          FROM i_action ia
          LEFT JOIN i_attribute_value iav
               ON iav.ia_action_seq = ia.action_seq
          LEFT JOIN shared_action_attribute
               ON sactatt_sact_code = sact_code
             AND sactatt_sat_type = sat_type
         WHERE ia.deleted = 'A'
    )
    SELECT       action_seq
    ,       action_date
    ,       action_code
    ,       staff_seq
    ,       MIN (first_attribute)          AS first_attribute
    ,       MIN (second_attribute)     AS second_attribute
    FROM       ungrouped_data
    GROUP BY  action_seq
    ,       action_date
    ,       action_code
    ,       staff_seq
    ;
    

    There are other alternatives for special cases, but none of them work in this particular case.

  • 2-table join

    Dear all,

    I have 2 tables say, table 1 and table 2 that looks like this.

    TABLE1:

     

    REPORT_ID

    Report_Name

    Report_Created_By

    Report_Created_On

    A

    R1

    C1

    January 1, 2013

    B

    R2

    C2

    January 2, 2014

    C

    R3

    C3

    02_Feb-2012

    D

    R4

    C4

    3 March 2016

    TABLE2

     

    Sys_ID

    REPORT_ID

    Report_Run_On

    Report_Run_By

    1

    A

    January 1, 2015

    User1

    2

    B

    January 2, 2015

    User2

    3

    A

    02_Feb-2015

    Util_3

    4

    A

    March 3, 2015

    User4

    How can I join these tables so that my resulting table looks like this,

    RESULT

     

    REPORT_ID

    Report_Name

    Report_Run_On

    (The last execution date and time)

    Report_Run_By

    (The last execution user)

    A

    R1

    March 3, 2015

    User4

    B

    R2

    January 2, 2015

    User2

    C

    R3

    D

    R4

    Thanks in advance,

    Séverine Suresh

    Hey, Sebastian,

    Séverine Suresh - 3035408 wrote:

    Dear all,

    I have 2 tables say, table 1 and table 2 that looks like this.

    TABLE1:

    REPORT_ID

    Report_Name

    Report_Created_By

    Report_Created_On

    A

    R1

    C1

    January 1, 2013

    B

    R2

    C2

    January 2, 2014

    C

    R3

    C3

    02_Feb-2012

    D

    R4

    C4

    3 March 2016

    TABLE2

    Sys_ID

    REPORT_ID

    Report_Run_On

    Report_Run_By

    1

    A

    January 1, 2015

    User1

    2

    B

    January 2, 2015

    User2

    3

    A

    02_Feb-2015

    Util_3

    4

    A

    March 3, 2015

    User4

    How can I join these tables so that my resulting table looks like this,

    RESULT

    REPORT_ID

    Report_Name

    Report_Run_On

    (The last execution date and time)

    Report_Run_By

    (The last execution user)

    A

    R1

    March 3, 2015

    User4

    B

    R2

    January 2, 2015

    User2

    C

    R3

    D

    R4

    Thanks in advance,

    Séverine Suresh

    So, you want a row of output for each row in table1, even if there is no corresponding row in table2.  This looks like a job for an outer join.

    Also, you want to only 1 row of output for each report_id, even if there are 2 or more matching rows in table2.  This sounds like a job for GROUP BY.  (I know you asked only about how to join the tables, but I think there is no harm in mentioning also GROUP BY.)

    Here's a way to do it:

    SELECT t1.report_id

    t1.report_name

    MAX (t2.report_run_on) AS lasr_run

    MIN (t2.report_run_by)

    KEEP (DENSE_RANK LAST ORDER BY report_run_on) AS last_run_by

    FROM table1 t1

    LEFT OUTER JOIN table2 t2 ON t2.report_id = t1.report_id

    GROUP BY t1.report_id

    t1.report_name

    ORDER BY t1.report_id

    ;

    If you would care to post CREATE TABLE and INSERT starements for the sample data, and then I could test this.

  • Multiple Table join without loss of data - SQL help

    Hello
    I have the following tables 3 employee as indicated in the scripts below, please help in writing SQL that connects all these 3 tables and displays the output as shown below

    Required output
    EMP ID Loc Value 1 Value 2 Value 3                    
    1     A     3     1     6
    1 B 4 9 null
    Value null null 1 Wh 8
    2 Z 4 9 null
    3 R 0 null 1
    4 Y 1 null null
    5 O 7 7 null
    Value null null 5 Wh 5
    6 M 7 null 7
    6 B null null 8

    / * Create Tables * /.
    Create table Emp1 (Empid number, Loc Varchar2 (10), Value_1 number);
    Create the Emp2 Table (Empid number, Loc Varchar2 (10), Value_2 number);
    Create table emp3 (empid number, loc varchar2 (10), Value_3);

    / * Insert Scripts * /.
    Insert Into Emp1 Values (1, 'A', 3);
    Insert Into Emp1 Values (2, 'Z', 4);
    Insert Into Emp1 Values (3, 'R', 0);
    Insert Into Emp1 Values (4, 'Y', 1);
    Insert Into Emp1 Values (5, 'o', 7);
    Insert Into Emp1 Values (6, am', 7);

    Insert Into Emp2 Values (1, 'A', 1);
    Insert Into Emp2 Values (1, 'B', 4);
    Insert Into Emp2 Values (1, 'Wh', 8);
    Insert Into Emp2 Values (2, 'Z', 9);
    Insert Into Emp2 Values (5, 'o', 7);
    Insert Into Emp2 Values (5, 'Wh', 5);

    Insert Into Emp3 Values (1, 'A', 6);
    Insert Into Emp3 Values (1, 'B', 9);
    Insert Into Emp3 Values (3, 'R', 1);
    Insert Into Emp3 Values (6, am', 7);
    Insert Into Emp3 Values (6, 'B', 8);
    Commit;


    Thank you
    Varun

    Like this?

    SQL> select nvl(e.empid, e3.empid) empid
      2       , nvl(e.loc, e3.loc) loc
      3       , e.value_1
      4       , e.value_2
      5       , e3.value_3
      6    from (
      7            select nvl(e1.empid, e2.empid) empid
      8                 , nvl(e1.loc, e2.loc) loc
      9                 , e1.value_1
     10                 , e2.value_2
     11              from emp1 e1
     12              full join emp2 e2
     13                on e1.empid = e2.empid
     14               and e1.loc = e2.loc
     15         ) e
     16    full join emp3 e3
     17      on e.empid = e3.empid
     18     and e.loc = e3.loc
     19   order
     20      by empid
     21       , loc
     22  /
    
         EMPID LOC           VALUE_1    VALUE_2    VALUE_3
    ---------- ---------- ---------- ---------- ----------
             1 A                   3          1          6
             1 B                              4          9
             1 Wh                             8
             2 Z                   4          9
             3 R                   0                     1
             4 Y                   1
             5 O                   7          7
             5 Wh                             5
             6 B                                         8
             6 M                   7                     7
    
    10 rows selected.
    
    SQL> 
    
  • ORA-01733 on update of version (view) table join

    I'm doing an update to a table with version of workspace manager (Workspace Manager replaces the table with his own point of view) using a line join view (because the merger does not display of INSTEAD of triggers). It works very well on a normal table and simple updates on the work of versioned table but when I try the join implementation update on a table with version, I get "ORA-01733: virtual column not allowed here."
    I do not understand why it gives ORA-01733 here. Can someone explain and help me get the join update to work?
    The version is 11.2.0.3

    I can use the update successfully while the table is not versioned.
    The Workspace Manager view isn't a self-join, and the column is not a function or an expression.
    I update the columns show also editable in user_updatable_columns
    I'm prototyping this for an application. I need to make large updates - there could be 10,000 rows with 80 columns updated, and I will do this for the 200 paintings, so I don't want to upgrade from postcode =(select...) set suppliers
    Here is a script to demonstrate the problem:
    create table suppliers (supplier varchar2(10) not null, postcode varchar2(10), v1 number, v2 number, v3 number, constraint suppliers_pk primary key (supplier));
    create table sup_data (supplier varchar2(10) not null, new_postcode varchar2(10), nv1 number, nv2 number, nv3 number, constraint sup_data_pk primary key (supplier));
    insert into suppliers values ('NORTH', null, 1, 2, 3);
    insert into sup_data values ('NORTH', '3000', 1.1, 2.2, 3.3);
    commit;
    update suppliers set postcode='1000', v1=0.1, v2=0.2, 
    update (select d.postcode, s.new_postcode , d.v1, d.v2, d.v3, s.nv1, s.nv2, s.nv3 from suppliers d join sup_data s on d.supplier = s.supplier)
    set postcode= new_postcode, v1 = nv1, v2 = nv2, v3 = nv3 ;
    -- That succeeded. Now try with the workspace manager versioning view.
    rollback;
    exec DBMS_WM.EnableVersioning ('suppliers', hist=> 'VIEW_WO_OVERWRITE');
    update (select d.postcode, s.new_postcode , d.v1, d.v2, d.v3, s.nv1, s.nv2, s.nv3 from suppliers d join sup_data s on d.supplier = s.supplier)
    set postcode= new_postcode, v1 = nv1, v2 = nv2, v3 = nv3 ;
    -- set postcode= new_postcode
    --     *
    -- ERROR at line 2:
    -- ORA-01733: virtual column not allowed here
    
    -- Try with an explicit view:
    create view sup_updt as select d.postcode, s.new_postcode , d.v1, d.v2, d.v3, s.nv1, s.nv2, s.nv3 from suppliers d join sup_data s on d.supplier = s.supplier;
    select * from user_updatable_columns where table_name = 'SUP_UPDT';
    
    select * from sup_updt;
    update sup_updt set postcode= new_postcode, v1 = nv1, v2 = nv2, v3 = nv3 ;
    -- update sup_updt set postcode= new_postcode, v1 = nv1, v2 = nv2, v3 = nv3
    --                     *
    -- ERROR at line 1:
    -- ORA-01733: virtual column not allowed here
     
    Thanks for your help

    Published by: davidp 2 on April 17, 2013 19:17

    Oracle development explained the ORA-1733:

    The update fails because the target (select d.postcode, s.new_postcode, d.v1, d.v2, d.v3, s.nv1, s.nv2, v_suppliers s.nv3 d join s on d.supplier = s.supplier sup_data) the update is a non merged display inline.  An update on a view must be translatable for an update on an underlying table. Thus, all the views mentioned in the update must be seen that can be merged. The same phenomenon occurs when you create instead of trigger on the view v_suppliers [was] not that can be merged, leading to the error downstream.

    For example, an (undocumented) ORA-1733 means "can not update display not merged."

  • How to insert a record for tables joined

    Hello
    first of all I learned forms for a few days.
    I created a simple form where report columns from two tables to join them.
    Once I entered a new list of values in the fields in the form, how can I insert them in the two tables? What I did, but it does not work, is to "Insert the name of procedure" of the data block = my procedure compiled in "Units of program" in the hope that once pushed the "run query button" in the form running worked, but it did not work.
    Any advice for the best way how perform an insertion in one or more tables with the contents of the form fields?

    My versions are: 10gXE and 10.1.2.0.2 forms database

    Thanks in advance!

    You can create a trigger INSERTION-IT-in the form and your two inserts here. A more 'clean' approach would be to create a database view and your block based on that point of view. Then create INSTEAD OF triggers on the view to insert the data in the two tables.

  • Attendance and leave table Join

    Hello
    I would like to join both of the following tables 'Présences' and 'Quit', common key is EMP # EMPLOYEE_NUMBER = but the problem is that the range of table stores (date start and end) leaves leave not daily record in this case how can I generate each record a day off at the joint with the attendance table or any other solution someone suggest table (where the leaves set at startup and date) end).

    Thank you and best regards,
    Syed Khawar


    Table of presence
    --CREATE ATTENDANCE TABLE
    CREATE TABLE ATTENDANCE
    (EMP_ID VARCHAR2(20), ATT_DATE DATE, 
     TIMEIN DATE, TIMEOUT DATE, LATE_IN VARCHAR2(10), EARLY_OUT VARCHAR2(10), REASON VARCHAR2(10));
     
    --INSERT INTO ATTENDANCE
     Insert into ATTENDANCE
       (EMP_ID, ATT_DATE, TIMEIN, TIMEOUT, LATE_IN, EARLY_OUT)
     Values
       ('0265', TO_DATE('07/01/2012 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('08/01/2012 07:31:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('08/01/2012 15:02:00', 'MM/DD/YYYY HH24:MI:SS'), '00:00', 
        '00:00');
    Insert into ATTENDANCE
       (EMP_ID, ATT_DATE, TIMEIN, TIMEOUT, LATE_IN, EARLY_OUT)
     Values
       ('0265', TO_DATE('07/02/2012 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('08/01/2012 07:31:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('08/01/2012 15:05:00', 'MM/DD/YYYY HH24:MI:SS'), '00:00', 
        '00:00');
    Insert into ATTENDANCE
       (EMP_ID, ATT_DATE, TIMEIN, TIMEOUT, LATE_IN, EARLY_OUT)
     Values
       ('0265', TO_DATE('07/03/2012 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('08/01/2012 07:18:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('08/01/2012 07:18:00', 'MM/DD/YYYY HH24:MI:SS'), '00:00', 
        '07:42');
    Insert into ATTENDANCE
       (EMP_ID, ATT_DATE, TIMEIN, TIMEOUT, LATE_IN, EARLY_OUT)
     Values
       ('0265', TO_DATE('07/07/2012 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('08/01/2012 07:47:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('08/01/2012 15:06:00', 'MM/DD/YYYY HH24:MI:SS'), '00:17', 
        '00:00');
    Insert into ATTENDANCE
       (EMP_ID, ATT_DATE, TIMEIN, TIMEOUT, LATE_IN, EARLY_OUT)
     Values
       ('0265', TO_DATE('07/08/2012 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('08/01/2012 07:44:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('08/01/2012 15:14:00', 'MM/DD/YYYY HH24:MI:SS'), '00:00', 
        '00:00');
    Insert into ATTENDANCE
       (EMP_ID, ATT_DATE, TIMEIN, TIMEOUT, LATE_IN, EARLY_OUT)
     Values
       ('0265', TO_DATE('07/09/2012 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('08/01/2012 07:20:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('08/01/2012 15:08:00', 'MM/DD/YYYY HH24:MI:SS'), '00:00', 
        '00:00');
    Insert into ATTENDANCE
       (EMP_ID, ATT_DATE, TIMEIN, TIMEOUT, LATE_IN, EARLY_OUT)
     Values
       ('0265', TO_DATE('07/10/2012 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('08/01/2012 07:28:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('08/01/2012 15:02:00', 'MM/DD/YYYY HH24:MI:SS'), '00:00', 
        '00:00');
    Insert into ATTENDANCE
       (EMP_ID, ATT_DATE, TIMEIN, TIMEOUT, LATE_IN, EARLY_OUT)
     Values
       ('0265', TO_DATE('07/11/2012 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('08/01/2012 07:26:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('08/01/2012 14:59:00', 'MM/DD/YYYY HH24:MI:SS'), '00:00', 
        '00:00');
    Insert into ATTENDANCE
       (EMP_ID, ATT_DATE, TIMEIN, TIMEOUT, LATE_IN, EARLY_OUT)
     Values
       ('0265', TO_DATE('07/14/2012 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('08/01/2012 07:25:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('08/01/2012 15:10:00', 'MM/DD/YYYY HH24:MI:SS'), '00:00', 
        '00:00');
    Insert into ATTENDANCE
       (EMP_ID, ATT_DATE, TIMEIN, TIMEOUT, LATE_IN, EARLY_OUT)
     Values
       ('0265', TO_DATE('07/15/2012 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('08/01/2012 07:42:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('08/01/2012 15:07:00', 'MM/DD/YYYY HH24:MI:SS'), '00:00', 
        '00:00');
    Insert into ATTENDANCE
       (EMP_ID, ATT_DATE, TIMEIN, TIMEOUT, LATE_IN, EARLY_OUT)
     Values
       ('0265', TO_DATE('07/16/2012 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('08/01/2012 07:20:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('08/01/2012 15:08:00', 'MM/DD/YYYY HH24:MI:SS'), '00:00', 
        '00:00');
    Insert into ATTENDANCE
       (EMP_ID, ATT_DATE, TIMEIN, TIMEOUT, LATE_IN, EARLY_OUT)
     Values
       ('0265', TO_DATE('07/17/2012 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('08/01/2012 07:38:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('08/01/2012 15:06:00', 'MM/DD/YYYY HH24:MI:SS'), '00:00', 
        '00:00');
    Insert into ATTENDANCE
       (EMP_ID, ATT_DATE, TIMEIN, TIMEOUT, LATE_IN, EARLY_OUT)
     Values
       ('0265', TO_DATE('07/18/2012 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('08/01/2012 07:54:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('08/01/2012 15:02:00', 'MM/DD/YYYY HH24:MI:SS'), '00:24', 
        '00:00');
    COMMIT;
    
    --SAMPLE DATA
    EMP_ID     ATT_DATE     TIMEIN     TIMEOUT     LATE_IN     EARLY_OUT     REASON
    265     01/07/2012     01/08/2012 7:31     01/08/2012 15:02     0:00     0:00     
    265     02/07/2012     01/08/2012 7:31     01/08/2012 15:05     0:00     0:00     
    265     03/07/2012     01/08/2012 7:18     01/08/2012 7:18     0:00     7:42     
    265     07/07/2012     01/08/2012 7:47     01/08/2012 15:06     0:17     0:00     
    265     08/07/2012     01/08/2012 7:44     01/08/2012 15:14     0:00     0:00     
    265     09/07/2012     01/08/2012 7:20     01/08/2012 15:08     0:00     0:00     
    265     10/07/2012     01/08/2012 7:28     01/08/2012 15:02     0:00     0:00     
    265     11/07/2012     01/08/2012 7:26     01/08/2012 14:59     0:00     0:00     
    265     14/07/2012     01/08/2012 7:25     01/08/2012 15:10     0:00     0:00     
    265     15/07/2012     01/08/2012 7:42     01/08/2012 15:07     0:00     0:00     
    265     16/07/2012     01/08/2012 7:20     01/08/2012 15:08     0:00     0:00     
    265     17/07/2012     01/08/2012 7:38     01/08/2012 15:06     0:00     0:00     
    265     18/07/2012     01/08/2012 7:54     01/08/2012 15:02     0:24     0:00     
    Leave the Table
    --CREATE LEAVE TABLE
    CREATE TABLE LEAVE 
    (
      EMPLOYEE_NUMBER  VARCHAR2(30 BYTE),
      LEAVE_TYPE       VARCHAR2(30 BYTE)            NOT NULL,
      LEAVE_REASON     VARCHAR2(240 BYTE),
      DATE_START       DATE,
      DATE_END         DATE
    );
    
    --INSERT LEAVE TABLE
    Insert into LEAVE
       (EMPLOYEE_NUMBER, LEAVE_TYPE, LEAVE_REASON, DATE_START, DATE_END)
     Values
       ('0265', 'Emergency leave', 'Emergency', TO_DATE('07/04/2012 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('07/04/2012 00:00:00', 'MM/DD/YYYY HH24:MI:SS'));
    Insert into LEAVE
       (EMPLOYEE_NUMBER, LEAVE_TYPE, LEAVE_REASON, DATE_START, DATE_END)
     Values
       ('0265', 'Annual Leave', 'Vacation', TO_DATE('06/23/2012 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('06/25/2012 00:00:00', 'MM/DD/YYYY HH24:MI:SS'));
    Insert into LEAVE
       (EMPLOYEE_NUMBER, LEAVE_TYPE, LEAVE_REASON, DATE_START, DATE_END)
     Values
       ('0265', 'Emergency leave', 'Emergency', TO_DATE('06/04/2012 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('06/04/2012 00:00:00', 'MM/DD/YYYY HH24:MI:SS'));
    Insert into LEAVE
       (EMPLOYEE_NUMBER, LEAVE_TYPE, LEAVE_REASON, DATE_START, DATE_END)
     Values
       ('0265', 'Annual Leave', 'Vacation', TO_DATE('02/12/2011 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('02/14/2011 00:00:00', 'MM/DD/YYYY HH24:MI:SS'));
    Insert into LEAVE
       (EMPLOYEE_NUMBER, LEAVE_TYPE, LEAVE_REASON, DATE_START, DATE_END)
     Values
       ('0265', 'Annual Leave', 'Vacation', TO_DATE('03/08/2011 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('03/08/2011 00:00:00', 'MM/DD/YYYY HH24:MI:SS'));
    Insert into LEAVE
       (EMPLOYEE_NUMBER, LEAVE_TYPE, LEAVE_REASON, DATE_START, DATE_END)
     Values
       ('0265', 'Annual Leave', 'Vacation', TO_DATE('06/18/2011 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('06/19/2011 00:00:00', 'MM/DD/YYYY HH24:MI:SS'));
    Insert into LEAVE
       (EMPLOYEE_NUMBER, LEAVE_TYPE, LEAVE_REASON, DATE_START, DATE_END)
     Values
       ('0265', 'Annual Leave', 'Vacation', TO_DATE('07/03/2011 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('07/06/2011 00:00:00', 'MM/DD/YYYY HH24:MI:SS'));
    Insert into LEAVE
       (EMPLOYEE_NUMBER, LEAVE_TYPE, LEAVE_REASON, DATE_START, DATE_END)
     Values
       ('0265', 'Annual Leave', 'Vacation', TO_DATE('08/01/2011 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('08/01/2011 00:00:00', 'MM/DD/YYYY HH24:MI:SS'));
    Insert into LEAVE
       (EMPLOYEE_NUMBER, LEAVE_TYPE, LEAVE_REASON, DATE_START, DATE_END)
     Values
       ('0265', 'Annual Leave', 'Vacation', TO_DATE('08/20/2011 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('08/20/2011 00:00:00', 'MM/DD/YYYY HH24:MI:SS'));
    COMMIT;
    
    --SAMPLE DATA
    EMPLOYEE_NUMBER     LEAVE_TYPE     LEAVE_REASON     DATE_START     DATE_END
    0265     Emergency leave     Emergency     04/07/2012     04/07/2012
    0265     Annual Leave     Vacation     23/06/2012     25/06/2012
    0265     Emergency leave     Emergency     04/06/2012     04/06/2012
    0265     Annual Leave     Vacation     12/02/2011     14/02/2011
    0265     Annual Leave     Vacation     08/03/2011     08/03/2011
    0265     Annual Leave     Vacation     18/06/2011     19/06/2011
    0265     Annual Leave     Vacation     03/07/2011     06/07/2011
    0265     Annual Leave     Vacation     01/08/2011     01/08/2011
    0265     Annual Leave     Vacation     20/08/2011     20/08/2011
    
    --Expected Output
    
    EMP_ID     ATT_DAY     ATT_DATE     TIMEIN     TIMEOUT     LATE_IN     EARLY_OUT     REASON
    0265     Sunday        01/07/2012     7:31     15:02     0:00     0:00     
    0265     Monday        02/07/2012     7:31     15:05     0:00     0:00     
    0265     Tuesday       03/07/2012     7:18     7:18     0:00     7:42     
    0265     Wednesday     04/07/2012                         Emergency
    0265     Saturday      07/07/2012     7:47     15:06     0:17     0:00     
    0265     Sunday        08/07/2012     7:44     15:14     0:00     0:00     
    0265     Monday        09/07/2012     7:20     15:08     0:00     0:00     
    0265     Tuesday       10/07/2012     7:28     15:02     0:00     0:00     
    0265     Wednesday     11/07/2012     7:26     14:59     0:00     0:00     
    0265     Saturday      14/07/2012     7:25     15:10     0:00     0:00     
    0265     Sunday        15/07/2012     7:42     15:07     0:00     0:00     
    0265     Monday        16/07/2012     7:20     15:08     0:00     0:00     
    0265     Tuesday       17/07/2012     7:38     15:06     0:00     0:00     
    0265     Wednesday     18/07/2012     7:54     15:02     0:24     0:00     
    Creation of fixed table of attendance & Insert statements

    Published by: Syed Khawar on August 6, 2012 22:09

    Hi, Syed,

    Syed Khawar wrote:
    Hello
    I would like to join both of the following tables 'Présences' and 'Quit', common key is EMP # EMPLOYEE_NUMBER = but the problem is that stores table leave range (date start and end) leaves not save all the days in this case how can I generate each peak day of range date someone suggest to associate myself with the table of attendance or any other solution.

    Join the table of leave for a Meter of Table (actually a set of results in this case) that counts from 1 to the number of days between date_start and date_end.

    Table of presence

    --CREATE ATTENDANCE TABLE
    
    CREATE TABLE ATTENDANCE
    (EMP_ID VARCHAR2(20), ATT_DAY VARCHAR2(10), ATT_DATE DATE,
    TIMEIN DATE, TIMEOUT DATE, LATE_IN VARCHAR2(10), EARLY_OUT VARCHAR2(10), REASON VARCHAR2(10));
    
    --INSERT INTO ATTENDANCE
    
    Insert into ATTENDANCE
    (EMP_ID, ATT_DAY, ATT_DATE, TIMEIN, TIMEOUT, LATE_IN, EARLY_OUT)
    Values
    ('0265', 'Sunday   ', TO_DATE('07/01/2012 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), '07:31', '15:02',
    '00:00', '00:00');
    

    Thanks for posting the CREATE TABLE and INSERT. Don't forget why you're going to all this trouble: so people who want to help you can recreate the problem and test their ideas. If you post statements that do not work, it is not very useful. None of these statements "INSERT INTO attendance" works for me. If timein and timeout are DATEs, so don't try to insert VARCHAR2 values (for example 17:31 ') in them.
    Why must you 4 columns att_day, att_date, timein, timeout? Why not just timein and timeout (two DATEs)?

    I think you want something like this:

    WITH     got_leave_days     AS
    (
         SELECT     leave.*
         ,     1 + date_end
                - date_start          AS leave_days
         FROM     leave
    )
    ,     cntr          AS
    (
         SELECT     LEVEL - 1          AS n
         FROM     (
                   SELECT  MAX (leave_days)     AS max_leave_days
                   FROM     got_leave_days
              )
         CONNECT BY     LEVEL     <= max_leave_days
    )
    SELECT       emp_id
    ,       att_day     -- or TO_CHAR (att_date, 'Day')
    ,       att_date
    ,       timein
    ,       timeout
    ,       early_out
    ,       NULL               AS reason
    FROM       attendance
                --
         UNION ALL
           --
    SELECT       l.employee_number     AS emp_id
    ,       TO_CHAR  ( l.date_start + c.n
                   , 'Day'
                 )          AS att_day
    ,       l.date_start + c.n     AS att_date
    ,       NULL                  AS timein
    ,       NULL               AS timeout
    ,       NULL               AS earlyout
    ,       leave_reason          AS reason
    FROM       got_leave_days  l
    JOIN       cntr            c  ON  c.n  <= l.leave_days
           --
    ORDER BY  emp_id
    ,            att_date
    ;
    

    This would not exactly what you said you wanted to. I suspect you have other requirements or the results you posted are not correct for the data. Whatever the problem, that is, you can probably resolve the application above to do what you want.

  • Impdp exclude tables error

    Hello

    I published impdp like this

    $impdp dumpfile = xxxxx.dmp = directory = xxxxxx = table exclude xxx.log logfile: "('scott.emp', 'tiger.dept') IN ' full = version of y = 10.2.0.3"

    get the error

    "exclude formed incorrectly.

    Thanks in advance

    g

    Better, you use a settings file, which is especially more easy:

    http://docs.Oracle.com/CD/E11882_01/server.112/e22490/dp_import.htm#BEHECGCA

  • How to exclude table as % of AUDIT using the Datapump API

    Hello
    I try to use the datapump API to import the table into a database link, excluding the table with a name like % AUDIT. I have it working all except running the table. I use Oracle 11.1.0.6.

    It works in my application
    in DB R11.2
    in job_mode = "TABLE".

    () dbms_datapump.metadata_filter
    handle-online job_handle,
    name-online "NAME_EXPR."
    value => "NOT IN ("TABLENAME_1","TABLENAME_2","TABLE_NAME_3")"
    );

    Try this works for you

    () dbms_datapump.metadata_filter
    handle-online job_handle,
    name-online "NAME_EXPR."
    value-online "LOVE NOT"AUDIT %""
    );

    Published by: astramare on July 7, 2011 14:57

  • Table join Insert help?

    Hi guys,.

    Basily, I need to update simply null 'start_date' (s) in TableB, with (s) 'start_date' from TableA.

    Joining tables by claim_no.

    I tried alog the lines of this:

    INSERT INTO TableB.start_date
    SELECT TableA.start_date FROM TableB INNER JOIN TableA
    ON TableA.Claim_no = TableB.Claim_no
    WHERE TableB.start_date is null


    But his return "column ambiguously defined".

    :-/

    Any suggestions? IM prob away from the brand here!

    Thank you JPM

    You need update instead of INSERTION

    UPDATE TableB
      SET start_date = ( SELECT TableA.start_date
                           FROM TableA INNER JOIN TableB
                             ON TableA.Claim_no = TableB.Claim_no
                       )
    WHERE start_date is null
    

    Concerning
    Arun

  • See the optimizer parameter - table or view does not exist

    one of our programmer must have the ability to run "display optimizer parameter. When he does he receives "table or view does not exist. When I run the system command, I don't get the error said. is the only way to get around this to grant specific rights within the database? If Yes, what level of rights I can grant him to allow a good performance? can I grant rights on the order only? -one

    You should think before giving grants rights and why it is necessary.

    grant select on sys.v_$parameter to your_user;
    

    Nicolas.

  • tables, join and summation

    Hello everyone, I wrote a query for this but unfortunately it does not work...

    I have two tables

    Table 1

    amount used_date
    29/12/2006 4
    30/12/2006 3

    Table 2
    amount used_date
    29/12/2006 5
    30/12/2006 6

    Now, I have to join the two table and get the total sum of the amount... so the result should be... I have

    final table
    amount used_date
    18 2006

    I have problems with writing a query to do this, I'm still a beginner please note.

    Thank you.

    I guess that you do not want to join the tables, but combine all records on their part
    and calculate a total per year

    WITH TABLE_1 AS(
      SELECT  TO_DATE('12/29/2006', 'mm/dd/yyyy')  USED_DATE,  4 AMOUNT FROM DUAL UNION ALL
      SELECT TO_DATE('12/30/2006', 'mm/dd/yyyy') , 3 FROM DUAL
    ),
    TABLE_2 AS(
      SELECT  TO_DATE('12/29/2006', 'mm/dd/yyyy')  USED_DATE,  5 AMOUNT FROM DUAL UNION ALL
      SELECT TO_DATE('12/30/2006', 'mm/dd/yyyy') , 6 FROM DUAL
    )
    SELECT extract(YEAR from used_date) year, SUM(AMOUNT)
    FROM (
      SELECT * FROM TABLE_1
      UNION ALL
      SELECT * FROM TABLE_2
    )
    GROUP BY extract(YEAR from used_date)
    ;
    
    YEAR                   SUM(AMOUNT)
    ---------------------- ----------------------
    2006                   18                     
    
  • MV incremental update on remote database table join query

    Hello

    I am creating a MV with incremental refresh option on a join query with 2 tables of database remote.

    Created journals of MV on 2 tables in the remote database.
    DROP MATERIALIZED VIEW LOG ON emp;
    CREATE MATERIALIZED VIEW LOG ON emp WITH ROWID;
    DROP MATERIALIZED VIEW LOG ON dept;
    CREATE MATERIALIZED VIEW LOG ON WITH ROWID dept;

    Now, try to create the MV,

    Mv_emp_dept CREATE MATERIALIZED VIEW
    IMMEDIATE CONSTRUCTION
    REFRESH QUICKLY
    START BY SYSDATE
    1 /(24*15) NEXT SYSDATE+.
    WITH THE PRIMARY KEY
    AS
    SELECT e.ename, e.job, d.dname FROM emp@remote_db e, dept@remote_db d
    WHERE e.deptno = d.deptno
    AND e.sal > 800;

    Get the error ORA-12052.

    Can you please help me.

    Thank you
    Anjan

    Need to include the ROWID in the mview. Should be something like: -.

    CREATE MATERIALIZED VIEW mv_emp_dept
    BUILD IMMEDIATE
    REFRESH FAST
    AS
    SELECT e.rowid rowide, e.ename, e.job, d.rowid rowidd, d.dname
    FROM emp@remote_db e,dept@remote_db d
    WHERE e.deptno=d.deptno
    AND e.sal>800;
    

Maybe you are looking for

  • HTML/crypted. Gen

    I keep getting random detections when using firefox. It happens at random times when I go to several different websites, including msn.so.uk and youtube.The AntiVir Guard appears, sometimes those of several pop up at the same time. It is said that th

  • Keyboard mixed up on all new Satellite C850-1F1

    The keyboard of my brand-new Satellite C850-1F1 is involved. 64-bit Windows 8 is installed. Space bar allows a 'p', 4 provides a 'f', 6 provides a "h". But most of the keys work properly. When using an external keyboard it al works fine. I tried diff

  • Bluetooth connection with headphones

    Hi forum, I bought the receiver rx2 Hama Bluetooth to connect my Portege via Bluetoothwith my home entertainment system. It works very well. Toshiba-bluetooth-stack handlesthe device as a Bluetooth headset. The only thing I miss, is an auto-connect-o

  • Unable to set up voicemail on over 6 sec.

    Hello, having set up my voicemail.  I can put it up nicely, but as soon as I click done, the screen tells me "Setup voice mail" and in fact nothing happens.  This statement is still on the phone until I close downwards.  So the next time I open the p

  • Vista cannot display my Nikon RAW files.

    My laptop running Vista Premium 64 - bit, 4 GB RAM, cannot display the RAW files from my new Nikon D7000, using Capture NX2 v2.2.6. The laptop has a small problem because files come when I change the user, but not when I open the program under my nam