OUTER JOIN -- Error: ORA-01417  (a table may be outer joined to at most one

Hi there,
I have a rather simple task: retrieve all the records in a table, for agiven domain p_domain_id (input parameter). The problem is that there are about 6 FKs in the table, and I need the names (strings) corresponding to those FKs (from other tables). Unfortunately, some of the FKs are NULL, so in '=' I loose records. Without the last 2 lines in WHERE clause, I get the correct result. With d2 in place (and without the "(+)" ) I loose 2 records. With the d3 (and also without "(+)"), I do not get any record.
With the "(+)", the code compiles but I get the run time error ORA-01417
NOTE: I put the "+" within parentheses, in order to show it like a text in this editor.
What's an elegant solution to this?
Thanks a lot.
Here's the code:
SELECT
a.DOMAIN,
b.NAME,
a.DE_ID,
a.NAME,
a.PREFERRED_LABEL,
a.TECHNICAL_DEFINITION,
a.PUBLIC_DEFINITION,
a.DE_TYPE,
c1.NAME,
a.HAS_PARAMETER,
a.VALUE_CLASS,
c2.NAME,
a.INDEX_TERMS,
a.DATA_TABLE_ID,
d1.TABLE_NAME,
a.SP_INSERT,
a.SP_UPDATE,
a.SP_GET_BYMRN,
a.SP_GET_BYATTRIBUTE,
a.VALUE_TABLE_ID,
d2.TABLE_NAME,
a.PARAM_TABLE_ID,
d3.TABLE_NAME,
a.PARAM_DOMAIN_LOGIC,
a.SP_LOV,
a.LOWER_LIMIT,
a.UPPER_LIMIT,
a.BOOLEAN_Y,
a.BOOLEAN_N,
a.COMMENTS,
a.ENTERED_BY,
commons_API.get_person_full_name(a.ENTERED_BY),
a.ENTERED_ON
FROM
DATA_ELEMENT_INDEX a,
DE_DOMAIN b,
GENERAL_LIST c1,
GENERAL_LIST c2,
TABLE_GROUP d1,
TABLE_GROUP d2,
TABLE_GROUP d3
WHERE
DOMAIN = p_domain_id AND
b.DOMAIN_ID = a.DOMAIN AND
c1.ID = a.DE_TYPE AND
c2.ID = a.VALUE_CLASS AND
d1.TABLE_ID = a.DATA_TABLE_ID AND -- it works well without the next two lines
d2.TABLE_ID = a.VALUE_TABLE_ID "(+)" AND
d3.TABLE_ID = a.PARAM_TABLE_ID "(+)"
ORDER BY a.NAME;
Edited by: user10817976 on Oct 19, 2009 8:14 AM

One of my standard replies...
Oracle syntax does not support outer joining to more than one table.
However ANSI syntax does...
SQL> select * from a;
        ID      B_KEY      C_KEY
         1          2          3
         2          1          4
         3          3          1
         4          4          2
SQL> select * from b;
        ID     C_KEY2
         1          1
         2          5
         3          3
         4          2
SQL> select * from c;
      KEY1       KEY2 DTA
         1          1 1-1
         1          2 1-2
         1          3 1-3
         1          4 1-4
         2          1 2-1
         2          2 2-2
         2          3 2-3
         2          4 2-4
         3          1 3-1
         3          2 3-2
         3          3 3-3
         3          4 3-4
         4          1 4-1
         4          2 4-2
         4          3 4-3
         4          4 4-4
16 rows selected.
SQL> ed
Wrote file afiedt.buf
  1  select a.id as a_id, b.id as b_id, c.key1 as c_key1, c.key2 as c_key3, c.dta
  2  from a, b, c
  3  where a.b_key = b.id
  4  and   a.c_key = c.key1 (+)
  5* and   b.c_key2 = c.key2 (+)
SQL> /
and   a.c_key = c.key1 (+)
ERROR at line 4:
ORA-01417: a table may be outer joined to at most one other table
SQL> ed
Wrote file afiedt.buf
  1  select a.id as a_id, b.id as b_id, c.key1 as c_key1, c.key2 as c_key3, c.dta
  2  from a JOIN b ON (a.b_key = b.id)
  3*        LEFT OUTER JOIN c ON (a.c_key = c.key1 and b.c_key2 = c.key2)
SQL> /
      A_ID       B_ID     C_KEY1     C_KEY3 DTA
         3          3          1          3 1-3
         4          4          2          2 2-2
         2          1          4          1 4-1
         1          2
SQL>

Similar Messages

  • ORA-01417: a table may be outer joined to at most one other table

    Hi All,
    I want to display the data even if there is no corresposding data in the fac_pos table.
    when using outer joins getting error message.
    Any work around for this ? Please suggest. :-)
    SQL> SELECT case when flen.FPID is not null then
      2        'do the calculations here'
      3        else
      4        'no value in the FAC_POS table so do the ELSE PART'
      5       end CASE ,
      6       mtf.EXT_FID
      7          FROM
      8       D_F_MAP  MTF,
      9             FAC   EFAC,
    10             TRADING       EST,
    11             FAC_POS         FLEN,
    12             USERS_MAP custmap
    13       WHERE mtf.SRC_FID  = efac.FID (+)
    14         AND mtf.SRC_DID  = efac.DID  (+)
    15         AND efac.TFID = est.TFID 
    16         AND mtf.EXT_FID (+) = flen.FID              
    17         AND mtf.EXT_DID (+)  = flen.DID 
    18      AND custmap.SRC_CUST_ID   =  est.SID  (+)     
    19         AND custmap.EXT_CUST_ID  =  flen.CUSTID (+)
    20      and est.TFID =14;
    no rows selected
    SQL> SELECT case when flen.FPID is not null then
      2        'do the calculations here'
      3        else
      4          'no value in the FAC_POS table so do the ELSE PART'
      5       end CASE ,
      6       flen.CUSTID FROM TRADING EST, USERS_MAP,FAC_POS FLEN,FAC EFAC, D_F_MAP  MTF
      7  WHERE
      8   EST.SID = USERS_MAP.SRC_CUST_ID        (+) AND
      9   USERS_MAP.EXT_CUST_ID   =  flen.CUSTID (+) AND
    10   MTF.SRC_DID (+) = EFAC.DID         AND
    11   MTF.SRC_FID (+) = EFAC.FID        AND
    12   efac.TFID = est.TFID         AND
    13   mtf.EXT_FID (+) = flen.FID                 AND         
    14   mtf.EXT_DID (+)  = flen.DID     AND
    15   est.TFID =14
    16  /
    MTF.SRC_FID (+) = EFAC.FID        AND
    ERROR at line 11:
    ORA-01417: a table may be outer joined to at most one other table
    create table D_F_MAP
      SOURCE  VARCHAR2(10) not null,
      SRC_DID VARCHAR2(8) not null,
      SRC_FID VARCHAR2(10) not null,
      EXT_DID VARCHAR2(20),
      EXT_FID VARCHAR2(20)
    create table FAC
      TFID  NUMBER,
      SRC   VARCHAR2(10),
      DID   NUMBER,
      FID   NUMBER,
      CSAMT NUMBER
    create table FAC_POS
      FPID   NUMBER,
      CUSTID NUMBER,
      SRC    VARCHAR2(10),
      DID    NUMBER,
      FID    NUMBER,
      SPOS   NUMBER
    create table PASS_OVER
      TFID VARCHAR2(20) not null,
      FLG  VARCHAR2(1)
    create table TRADING
      TFID  NUMBER not null,
      SRC   VARCHAR2(10),
      TDATE DATE,
      BID   NUMBER,
      SID   NUMBER
    create table USERS_MAP
      SRC_CUST_ID VARCHAR2(8) not null,
      EXT_CUST_ID VARCHAR2(20),
      SRC         VARCHAR2(10) not null
    insert into D_F_MAP (SOURCE, SRC_DID, SRC_FID, EXT_DID, EXT_FID)
    values ('KP', '854', '7754', '101', '1202');
    insert into D_F_MAP (SOURCE, SRC_DID, SRC_FID, EXT_DID, EXT_FID)
    values ('KP', '4545', '4444', '504', '1604');
    insert into D_F_MAP (SOURCE, SRC_DID, SRC_FID, EXT_DID, EXT_FID)
    values ('KP', '7858', '9646', '604', '1705');
    insert into D_F_MAP (SOURCE, SRC_DID, SRC_FID, EXT_DID, EXT_FID)
    values ('MS', '8799', '4544', '987', '1654');
    insert into FAC (TFID, SRC, DID, FID, CSAMT)
    values (10, 'KP', 854, 7754, 85000);
    insert into FAC (TFID, SRC, DID, FID, CSAMT)
    values (11, 'KP', 854, 7754, 44000);
    insert into FAC (TFID, SRC, DID, FID, CSAMT)
    values (12, 'KP', 4545, 4444, 47000);
    insert into FAC (TFID, SRC, DID, FID, CSAMT)
    values (13, 'KP', 7858, 9646, 80000);
    insert into FAC (TFID, SRC, DID, FID, CSAMT)
    values (14, 'MS', 8799, 4544, 60000);
    insert into FAC (TFID, SRC, DID, FID, CSAMT)
    values (15, 'KP', 854, 7754, 66000);
    insert into FAC_POS (FPID, CUSTID, SRC, DID, FID, SPOS)
    values (94, 5555, 'EXT', 504, 1604, 6000);
    insert into FAC_POS (FPID, CUSTID, SRC, DID, FID, SPOS)
    values (90, 1111, 'EXT', 101, 1202, 1000);
    insert into FAC_POS (FPID, CUSTID, SRC, DID, FID, SPOS)
    values (91, 2222, 'EXT', 302, 3652, 1000);
    insert into FAC_POS (FPID, CUSTID, SRC, DID, FID, SPOS)
    values (92, 3333, 'EXT', 987, 1654, 6000);
    insert into FAC_POS (FPID, CUSTID, SRC, DID, FID, SPOS)
    values (93, 4444, 'EXT', 604, 1705, 9000);
    insert into TRADING (TFID, SRC, TDATE, BID, SID)
    values (10, 'KP', to_date('10-02-2009', 'dd-mm-yyyy'), 1548, 96751);
    insert into TRADING (TFID, SRC, TDATE, BID, SID)
    values (11, 'KP', to_date('02-02-2009', 'dd-mm-yyyy'), 5468, 7895);
    insert into TRADING (TFID, SRC, TDATE, BID, SID)
    values (12, 'KP', to_date('20-02-2009', 'dd-mm-yyyy'), 1258, 6985);
    insert into TRADING (TFID, SRC, TDATE, BID, SID)
    values (13, 'KP', to_date('22-02-2009', 'dd-mm-yyyy'), 5468, 7865);
    insert into TRADING (TFID, SRC, TDATE, BID, SID)
    values (14, 'MS', to_date('18-02-2009', 'dd-mm-yyyy'), 4669, 6893);
    insert into TRADING (TFID, SRC, TDATE, BID, SID)
    values (15, 'KP', to_date('20-02-2009', 'dd-mm-yyyy'), 1548, 6975);
    insert into USERS_MAP (SRC_CUST_ID, EXT_CUST_ID, SRC)
    values ('9675', '1111', 'kp');
    insert into USERS_MAP (SRC_CUST_ID, EXT_CUST_ID, SRC)
    values ('5468', '2222', 'kp');
    insert into USERS_MAP (SRC_CUST_ID, EXT_CUST_ID, SRC)
    values ('6893', '3333', 'kp');
    insert into USERS_MAP (SRC_CUST_ID, EXT_CUST_ID, SRC)
    values ('5468', '4444', 'kp');
    insert into USERS_MAP (SRC_CUST_ID, EXT_CUST_ID, SRC)
    values ('7865', '5555', 'kp');
    insert into USERS_MAP (SRC_CUST_ID, EXT_CUST_ID, SRC)
    values ('6975', '6666', 'kp');
    insert into USERS_MAP (SRC_CUST_ID, EXT_CUST_ID, SRC)
    values ('6975', '7777', 'kp');
    insert into USERS_MAP (SRC_CUST_ID, EXT_CUST_ID, SRC)
    values ('6985', '8888', 'kp');Thanks.

    Hi,
    Thanks for posting the sample data in such a useful form! I'm sorry, I'm not at a database now, so I can't run it.
    What are the correct results you want from that data?
    You can outer-join to more than one table using ANSI notation.
    Another solution is to do some of the joins in a sub-query. It looks like the problem is with the est table. If you join all the tables except est in a sub-query, then you can join est to that result set in the main query.
    If you "want to display the data even if there is no corresponding data in the fac_pos table.", and fac_pos is being called flen, then you have the + signs in the wrong places.
    16         AND mtf.EXT_FID (+) = flen.FID              
    17         AND mtf.EXT_DID (+)  = flen.DID  means "display data from flen even if there is no match in mtf".

  • A table may be outer joined to at most one other table

    I am trying to use a lookup dim (C) with inputs from 2 different lookup dim (A and B). And I getting the following error:
    "a table may be outer joined to at most one other table"
    Any suggestion?

    This is sql limitation that you can not have queries like
    select ...
    from a, b, c
    where c.x1(+) = a.y
    and c.x2(+) = b.z
    Probaby you are genearting code similar to this. I will suggest to use Joiner instead of lookup as you have better control over join conditions there. Other option may be to use Transformation function.

  • SQL Statement error - ORA-00903: invalid table name

    Hi
    I have written a sql script that gets executed from a form within e-business suite. Unfortunately, the script is falling over with an error:
    unknown command beginning "MERGE INTO..." - rest of line ignored.
    unknown command beginning "USING edop..." - rest of line ignored.
    unknown command beginning "ON (elw.ro..." - rest of line ignored.
    unknown command beginning "WHEN MATCH..." - rest of line ignored.
    For a list of known commands enter HELP
    and to leave enter EXIT.
          SET ELW.billed_flag          = t.billed_flag,
    ERROR at line 2:
    ORA-00903: invalid table name the actual statement that is causing the issue is:
    MERGE INTO edopaif.table1 elw
    USING edopaif.tablw2 t
    ON (elw.rowid = t.LOAD_WORKING_ROWID)
    WHEN MATCHED THEN
       UPDATE
          SET ELW.billed_flag          = t.billed_flag,
              ELW.last_bill_generated   = t.last_bill_generated,
              ELW.last_bill_type        = t.last_bill_type,
              ELW.load_month            = t.load_month,
              ELW.BILL_TRANSACTION_ID   = t.bill_transaction_id
    WHEN NOT MATCHED THEN
       INSERT(error_meaning)
       VALUES('ROWID error with ins_ptia');The version of e-business suite that we are using is: 11.5.10.2.
    The version of the Oracle database that we are using is:
    Oracle9i Enterprise Edition Release 9.2.0.6.0 - 64bit Production
    PL/SQL Release 9.2.0.6.0 - Production
    CORE 9.2.0.6.0 Production
    TNS for IBM/AIX RISC System/6000: Version 9.2.0.6.0 - Production
    NLSRTL Version 9.2.0.6.0 - Production
    Please note that I am able to successfully run the statement directly connected as the APPS schema in the database - the error only occurs when the script is run from the forms front-end (which is really confusing me).
    Many thanks
    Paul

    Hi
    I've modified the script to include only the statement that is erroring and it still errors when executed from the front end application.
    Next I re-wrote the statement to use PL/SQL instead of the MERGE statement, to do the update, and the script completes succesfully, i.e.:
    DECLARE
       CURSOR cu_lw IS
             SELECT t.billed_flag,
                    t.last_bill_generated,
                    t.last_bill_type,
                    t.load_month,
                    t.bill_transaction_id,
                    t.load_working_rowid
               FROM table2 t;
    BEGIN
       FOR rec_cu_lw IN cu_lw LOOP
          UPDATE table1 elw
             SET ELW.billed_flag           = rec_cu_lw.billed_flag,
              ELW.last_bill_generated      = rec_cu_lw.last_bill_generated,
              ELW.last_bill_type           = rec_cu_lw.last_bill_type,
              ELW.load_month               = rec_cu_lw.load_month,
              ELW.BILL_TRANSACTION_ID      = rec_cu_lw.bill_transaction_id
          WHERE elw.rowid                  = rec_cu_lw.load_working_rowid;
       END LOOP;
    END;
    /I am still unsure as to why the MERGE statement is failing when executed in the front end, but completes in the backend with no issues at all. Obviously I would prefer to use the MERGE statement instead of PL/SQL to do the update.
    Thanks
    Paul

  • Reconciliation error: ORA-00903: invalid table name

    I am facing this error, below:
    SELECT * FROM WHERE ORC_KEY = ? AND UD_RES_P_KEY = ?: java.sql.SQLSyntaxErrorException: ORA-00903: invalid table name
    Is it a product issue from OIM 9.1.0.2?
    best regards,
    Robert

    No, it is not a product issue. Please go to the process definition tab related and
    set all Multivalued attribute as a key field in Reconciliation mapping in Process definition.
    Let me know the result, please.
    hope this helps,
    Thiago L Guimaraes

  • How to resolve error ORA-29491: invalid table for chunking?

    Hello,
    I'm trying to implement DBMS_PARALLEL_EXECUTE to speed up a huge update I need to do. I'm stuck on a problem with the table I'm using to test my procedure. Here's a simple test that produces the same error. As best I can tell, the table I'm declaring here is missing some kind of requirement that lets DBMS_PARALLEL_EXECUTE make use of it, but the docs and searching for the error code haven't turned up any useful discussions. Please help.
    drop table owner.why_cant_i_hold;
    create table owner.why_cant_i_hold (
    things VARCHAR2 (64),
    amount INT,
    CONSTRAINT why_cant_i_pk PRIMARY KEY (things)
    insert into why_cant_i_hold values ('limes', 8);
    insert into why_cant_i_hold values ('lemons', 8);
    insert into why_cant_i_hold values ('watermelons', 5);
    insert into why_cant_i_hold values ('cats', 4);
    insert into why_cant_i_hold values ('teacups',10);
    insert into why_cant_i_hold values ('mugs', 5);
    insert into why_cant_i_hold values ('eggs', 15);
    insert into why_cant_i_hold values ('jobs', 3);
    commit;
    -- got tasks?
    COLUMN task_name FORMAT A10
    SELECT task_name,
    status
    FROM user_parallel_execute_tasks;
    --exec DBMS_PARALLEL_EXECUTE.CREATE_TASK('holding');
    exec DBMS_PARALLEL_EXECUTE.CREATE_CHUNKS_BY_ROWID('holding', 'ODDEV03', 'why_cant_i_hold', true, 3);
    It seems like a really simple case here. The output is all successful until
    "Error starting at line 25 in command:
    exec DBMS_PARALLEL_EXECUTE.CREATE_CHUNKS_BY_ROWID('holding', 'owner', 'why_cant_i_hold', true, 3);
    Error report:
    ORA-29491: invalid table for chunking
    ORA-06512: at "SYS.DBMS_PARALLEL_EXECUTE", line 27
    ORA-06512: at "SYS.DBMS_PARALLEL_EXECUTE", line 121
    ORA-06512: at line 1"

    Oh. This was an easy one, table names are never really lower-case. Changing the value in my chunking call fixed the simple test:
    exec DBMS_PARALLEL_EXECUTE.CREATE_CHUNKS_BY_ROWID('holding', 'ODDEV03', 'WHY_CANT_I_HOLD', true, 3);
    It doesn't help with why my more complicated test case isn't working, but I have details to check before I ask again.
    EDIT: lesson learned... 'invalid table' doesn't mean the database can find the table you are talking about at all. I hope that's a help.
    Edited by: user519442 on Nov 16, 2011 12:33 PM

  • ORA-01417 error  - workaround

    Hi all, I have the following query
    select a.incident_id,incident_number, d.source_object_id, a.incident_status_id, d.TASK_ID TASK_ID ,jta.task_id assign_task_id, d.source_object_type_code, a.owner_group_id, a.customer_id,jta.resource_type_code, jta.resource_id
    FROM cs_incidents_all_b a, cs_incident_statuses_b b, Cs_Incident_Statuses_Tl c, jtf.jtf_tasks_b d, jtf_task_assignments jta, jtf_rs_groups_vl jrg
    WHERE b.incident_status_id = c.incident_status_id
    AND a.incident_status_id = b.incident_status_id
    AND c.language = 'EL'
    AND b.incident_status_id = 1
    AND a.owner_group_id IN (SELECT * FROM TABLE(CAST(xxi_szf_discoverer.get_lov_group_id('ΣΥΖΕΥΞΙΣ-ΒΛΑΒΟΔΙΑΧΕΙΡΙΣΤΕΣ') AS xxi_group_id_tab)))
    AND a.customer_id IN (SELECT * FROM TABLE(CAST(xxi_szf_discoverer.get_party_id('ΣΥΖΕΥΞΙΣ-ΒΛΑΒΟΔΙΑΧΕΙΡΙΣΤΕΣ','ΚΤΠ ΦΟΡΕΙΣ') AS xxi_party_id_tab)))
    AND a.incident_id = d.source_object_id (+)
    AND d.source_object_id IS NULL
    AND d.task_id = jta.task_id (+)
    AND jta.resource_type_code IS NULL
    AND jrg.group_id = jta.resource_id (+)
    order by incident_number
    As you see I need to find a workaround to replace the second outer join, otherwise I get the error : ORA-01417: a table may be outer joined to at most one other table
    Any suggestion will be appreciated...
    Alex

    Hi,
    I am also stuck in the same issue of ORA-01417. Can some body help with me in this? Thanks a lot.
    SELECT
         wi.bill_catgry_id
         , i.item_code
         , i.item_key
         , w.ord_num
         , i.pack
         , i.item_size
         , i.size_code
         , country_num
         , i.tag_descr
         , decode(pc_inline.PICK_QTY,'',p.PICK_QTY,pc_inline.pick_qty) pick_qty
         , UPPER(b.descr)
         , DECODE(:facility_num,3,id.dept_num,0) dept
    FROM pick p, item i, bill_catgry b, route r, work_ord w, whse_item wi,
    item_dept id
                   , (select ord_num, item_key, country_num, sum(pick_qty) pick_qty
    from pick_country
    group by ord_num, item_key, country_num) pc_inline
    , country c
    WHERE
              1=1
         AND w.ord_num=p.ord_num
         AND w.ship_date = TO_DATE(:ship_date,'DD-MON-RR')
    AND p.item_key = i.item_key
         AND p.item_key = wi.item_key
         AND p.item_key = id.item_key
         AND wi.item_key = id.item_key
         AND w.store_num = :store_num
    AND w.route_id = :route_id
         AND w.route_id = r.route_id
         AND w.work_type in ('R','S')
         AND wi.bill_catgry_id=b.bill_catgry_id                
         AND r.whse_num = :whse_num          
         AND w.ord_num = pc_inline.ord_num(+)     
    AND i.item_key = pc_inline.item_key(+)     
         AND pc_inline.COUNTRY_NUM = c.country_num(+)
    Any help is really appreciated.
    Thanks
    Yogesh.

  • Universe连接Oracle DB遇到ORA-01417 error

    Hi,
    我用Universe连接Oracle DB, 在universe 中join 了一些表,并且有几张表之间用了left outer join. 然后把Universe Export 到BOE上, 用Crystal Report连接这个universe, 在运行的时候得到下面这个error:
    "A database error occured. The database error text is ORA-01417: a table may be outer joined to at most one other table. (WIS 10901)"
    请教有没有遇到同样问题的,怎么解决的啊? 急。。。 谢谢!

    一张表是不能同时和两张或两张以上的表进行外连接的
    你可以这样写
    a.id=b.id() and a.name=c.name()
    但是你不能这样写
    a.id()=b.id and a.name()=c.name
    虽然这两种写法的结果是不一样的,但是你的问题就是这个。
    你可以去universe看一下,你的left outer join肯定有这样的情况存在。

  • ORA-01417

    Folks please solve my problem
    i have these tables in from clause, when am executing my code am getting the error
    ORA-01417
    Error Description:
    a table may be outer joined to at most one other table
                   TT12_.JE_HEADER_ID(+)=l.JE_HEADER_ID
              and      TT12_.segment1(+)=c.segment1
              and     TT12_.segment2(+)=c.segment2
              AND      TT_.JE_HEADER_ID(+)=l.JE_HEADER_ID
              and      TT_.segment1(+)=c.segment1
              and      TT_.segment2(+)=c.segment2
              AND      TT1_.JE_HEADER_ID(+)=l.JE_HEADER_ID
              and     TT1_.segment1(+)=c.segment1
              and     TT1_.segment2(+)=c.segment2How can we join them
    Please help me thanks....

    Hi,
    Use ANSI join syntax. For example:
    FROM           c
    JOIN           l     ON    ...
    LEFT OUTER JOIN  tt12_     ON    TT12_.JE_HEADER_ID     = l.JE_HEADER_ID
                    AND   TT12_.segment1          = c.segment1
                   AND   TT12_.segment2          = c.segment2
    LEFT OUTER JOIN  tt_     ON    TT_.JE_HEADER_ID          = l.JE_HEADER_ID
                    AND   TT_.segment1          = c.segment1
                   AND   TT_.segment2          = c.segment2
    LEFT OUTER JOIN  tt1_     ON    TT1_.JE_HEADER_ID          = l.JE_HEADER_ID
                    AND   TT1_.segment1          = c.segment1
                   AND   TT1_.segment2          = c.segment2
    ...That error only occurs using the older join notation, with +.
    Whenever you have a problem, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) from all tables.
    Also post the results you want from that data, and an explanation of how you get those results from that data, with specific examples.
    Simplify the proble as much as possible. In this case, you can probably show the problem with just 3 tables (c, l, and any one of the others), and just the columns necessary to join them.
    Always say which version of Oracle you're using.
    Edited by: Frank Kulash on Jul 29, 2011 9:32 AM

  • Getting ORA-00903:invalid table name with both system and table owner

    Hi All,
    Oracle version 9.2
    I'm trying to retrieve some information from a few tables and import them to Excel. I haven't got much idea about ORACLE, but I'm not able to do anything.
    I open SQL PLus, and use CONNECT SYSTEM/[email protected] AS SYSDBA
    The console shows connected.
    I use select table_name,owner from dba_tables where owner='USER1';
    I can see the tables I want to access in the output.
    I do select * from USER1.TABLE1 and also tried with select * from TABLE1, both return ORA-00903:invalid table
    I also tried to connect with "CONNECT USER1/[email protected]" also shows connected, but then same error ORA-00903:invalid table
    Could anyone guide me so I can find out whats going on wrong??
    Thanks.. Best regards!

    Great! this worked! At least now I know I can read the data.
    Now I would like to get the data from this table into Excel 2007, but I can't install Office in the ORACLE server, so I have setup my client computer (Windows 2003 server with Excel 2007).
    I installed the ORACLE ODBC driver, and put the TNSName.ora file into the network admin folder.
    I successfully create the ODBC connector, and try connection is successfull. However, when I try to get the data, Excel send an error saying that it cannot list the tables!
    Anyway, any simple solution will do. If there is an easy way of making ORACLE create for example a CSV file with all the data from the table it will be good as well. What would be the easiest way?

  • ORA-01409 NOSORT option may not be used

    Hi all,
    We've got a range partitioned table, each partition resides in a different tablespace (locally managed) thus :
    create tablespace abcblast_hit_test_data1
    datafile '/export/data/oracle/HLDDEV05/abcblast_hit_test_data1.dbf'
    size 2600m extent management local uniform size 2500m;
    create tablespace abcblast_hit_test_data2
    datafile '/export/data/oracle/HLDDEV05/abcblast_hit_test_data2.dbf'
    size 2600m extent management local uniform size 2500m;
    Two large SORTED files of data are sql*loaded into each partition, taking up ONE extent in each partition
    I then try to create a non-unique index on the table using NOSORT and get the error ORA-01409 NOSORT option may not be used; rows are not in ascending order
    ... with the following reasoning :
    For non-unique indexes the ROWID is considered part of the index key. This means that two rows that appear to be stored in ascending order may not be. If you create an index NOSORT, and two of the rows in the table have the same index values, but get split across two extents, the data block address of the first block in the second extent can be less than the data block address of the last block in the first extent. If these addresses are not in ascending order, the ROWIDs are not either. Since these ROWIDs are considered part of the index key, the index key is not in ascending order, and the create index NOSORT fails.
    BUT the data for each partition DOES reside in one extent :
    select partition_name, tablespace_name, extent_id, bytes
    from dba_extents
    where segment_name = 'ABCBLAST_HIT'
    and segment_type = 'TABLE PARTITION';
    PARTITION_NAME     TABLESPACE_NAME          EXTENT_ID     BYTES
    PART_01          ABCBLAST_HIT_TEST_DATA1     0          2621440000
    PART_02          ABCBLAST_HIT_TEST_DATA2     0          2621440000
    (Oracle 9.0.1 on Linux)
    HELP !!!! Does this mean we can't use NOSORT when building indexes on partitioned tables ?!
    (Note : if NOSORT is not used then a sort is performed which we are trying to avoid - final table will contain 1.6 billion rows and will consist of 50 partitions)

    Hi ,
    Still i am facing same error like. Can any body help me..
    The following index(es) on table KA31CVLA.CITY were processed:
    index KA31CVLA.CITY_PK was made unusable due to:
    ORA-01409: NOSORT option may not be used; rows are not in ascending order
    index KA31CVLA.CITY_UQ01 loaded successfully with 29761 keys
    i have create one table CITY in user KA31CVLA.
    CREATE TABLE CITY
    CNTRY_CD VARCHAR2(2 BYTE) NOT NULL,
    CITY_NM VARCHAR2(40 BYTE) NOT NULL,
    SEQ_NBR NUMBER(10) NOT NULL,
    POSTL_STT_EQNT_CD VARCHAR2(9 BYTE),
    LATITUDE NUMBER(9,5) NOT NULL,
    LONGITUDE NUMBER(9,5) NOT NULL
    and then added primary constraints
    ALTER TABLE CITY ADD CONSTRAINT KA31CVLA.CITY_PK PRIMARY KEY (CNTRY_CD, CITY_NM, SEQ_NBR)
    after this default unique index created as below
    CREATE UNIQUE INDEX KA31CVLA.CITY_PK ON KA31CVLA.CITY (CNTRY_CD, CITY_NM, SEQ_NBR)
    after that i have added one more constraints is
    CREATE UNIQUE INDEX KA31CVLA.CITY_UQ01 ON KA31CVLA.CITY (CITY_NM, POSTL_STT_EQNT_CD, CNTRY_CD, SEQ_NBR)
    Now trying to load data to KA31CVLA.CITY table through SQLLDR
    here is the command which i am executing to insert..
    SQLLDR CONTROL=D:\GMVS\city.ctl, DATA=D:\GMVS\sorted_city.dat log=D:\GMVS\sorted_log.log USERID="KA31CVLA/KA31CVLA123" DIRECT=Y
    Here is the control file details
    options (direct=true)
    unrecoverable
    load data
    truncate
    into table KA31CVLA.city
    sorted indexes (city_PK)
    reenable disabled_constraints
    fields terminated by "^"
    trailing nullcols
    (cntry_cd char,
    city_nm char,
    seq_nbr integer external,
    postl_stt_eqnt_cd Char,
    latitude integer external,
    longitude integer external)
    The total records insertd to table but i am getting above error in log files.
    The following index(es) on table KA31CVLA.CITY were processed:
    index KA31CVLA.CITY_PK was made unusable due to:
    ORA-01409: NOSORT option may not be used; rows are not in ascending order
    index KA31CVLA.CITY_UQ01 loaded successfully with 29761 keys

  • Change Data Capture error ORA-31428 at the subscription step?

    I am following this cookbook; http://www.oracle.com/technology/products/bi/db/10g/pdf/twp_cdc_cookbook_0206.pdf it was very helpful for me but at the subscription step when I give the list of all columns that I provided at create_change_table step with column_type_list I recieve this error;
    ORA-31428 : No publication contains all of the specified columns. One or more of the specified columns cannot be found in a single publication. Consult the ALL_PUBLISHED_COLUMNS view to see the current publications and change the subscription request to select only the columns that are in the same publication.
    When I check the view mentioned ALL_PUBLISHED_COLUMNS my columns are listed, strange behaviour. I searched for any comments on forums.oracle.com and metalink.oracle.com and even google but nothing just the explaination above :(
    If you have any comments it would be great, thank you again.
    Best regards.
    Hotlog Source : 9iR2 Solaris
    Hotlog Target : 10gR2 Solaris
    begin
    dbms_cdc_publish.create_change_table(
    owner => ‘cdc_stg_pub’,
    change_table_name => ‘udb_tcon_ct’,
    change_set_name => ‘udb_tcon_set’,
    source_schema => ‘udb’,
    source_table => ‘tcon’,
    column_type_list => ‘ncon number(12), ncst number(12), dwhencon date, twhomcon varchar2(50), cchancon number(3), cacticon number(5), tdatacon varchar2(1000)’,
    capture_values => ‘both’,
    rs_id => ‘y’,
    row_id => ‘n’,
    user_id => ‘n’,
    timestamp => ‘y’,
    object_id => ‘n’,
    source_colmap => ‘n’,
    target_colmap => ‘y’,
    options_string => null) ;
    end ;
    select x.change_set_name, x.column_name from ALL_PUBLISHED_COLUMNS x ;
    begin
    dbms_cdc_subscribe.create_subscription(
    change_set_name => ‘udb_tcon_set’,
    description => ‘UDB TCON change subscription’,
    subscription_name => ‘udb_tcon_sub1′);
    end;
    begin
    dbms_cdc_subscribe.subscribe(
    subscription_name => ‘udb_tcon_sub1′,
    source_schema => ‘udb’,
    source_table => ‘tcon’,
    column_list => ‘ncon,ncst,dwhencon,twhomcon,cchancon,cacticon,tdatacon’,
    subscriber_view => ‘udb_tcon_chg_view’) ;
    end ;
    CHANGE_SET_NAME COLUMN_NAME
    UDB_TCON_SET NCON
    UDB_TCON_SET NCST
    UDB_TCON_SET DWHENCON
    UDB_TCON_SET TDATACON
    UDB_TCON_SET CCHANCON
    UDB_TCON_SET CACTICON
    UDB_TCON_SET TWHOMCON
    7 rows selected
    PL/SQL procedure successfully completed
    begin
    dbms_cdc_subscribe.subscribe(
    subscription_name => ‘udb_tcon_sub1′,
    source_schema => ‘udb’,
    source_table => ‘tcon’,
    column_list => ‘ncon,ncst,dwhencon,twhomcon,cchancon,cacticon,tdatacon’,
    subscriber_view => ‘udb_tcon_chg_view’) ;
    end ;
    ORA-31428: no publication contains all the specified columns
    ORA-06512: at “SYS.DBMS_CDC_SUBSCRIBE”, line 19
    ORA-06512: at line 2
    I added the OS and Oracle versions of source and target.
    Message was edited by:
    TongucY

    nice catch, the error changed but still strange;
    SQL> select upper('ncon,ncst,dwhencon,twhomcon,cchancon,cacticon,tdatacon') from dual ;
    UPPER('NCON,NCST,DWHENCON,TWHO
    NCON,NCST,DWHENCON,TWHOMCON,CCHANCON,CACTICON,TDATACON
    SQL> begin
    2 dbms_cdc_subscribe.subscribe(
    3 subscription_name => 'udb_tcon_sub1',
    4 source_schema => 'udb',
    5 source_table => 'tcon',
    6 column_list => 'NCON,NCST,DWHENCON,TWHOMCON,CCHANCON,CACTICON,TDATACON',
    7 subscriber_view => 'udb_tcon_chg_view') ;
    8 end ;
    9 /
    begin
    dbms_cdc_subscribe.subscribe(
    subscription_name => 'udb_tcon_sub1',
    source_schema => 'udb',
    source_table => 'tcon',
    column_list => 'NCON,NCST,DWHENCON,TWHOMCON,CCHANCON,CACTICON,TDATACON',
    subscriber_view => 'udb_tcon_chg_view') ;
    end ;
    ORA-31466: no publications found
    ORA-06512: at "SYS.DBMS_CDC_SUBSCRIBE", line 19
    ORA-06512: at line 2

  • ORA-01799: a column may not be outer-joined to a subquery

    Hi,
    How to solve this problem below?
         and id2.invoice_line_id*(+)*=(select min(invoice_line_id)
              from TW.invoice_detail
              where invoice_id=239917
              and (bl_amount_currency='USD' AND actual_amount_currency='VND'
              OR bl_amount_currency='VND' AND actual_amount_currency='USD')
    ERROR at line 150:
    ORA-01799: a column may not be outer-joined to a subquery
    Since there's an uncertain existence in id2, it needs to be outer-joined to that!
    Bst Rgds,
    HuaMin

    You cant do a outer join on a sub query. Can you describe what are you trying to do?

  • SQL Error: ORA-00942: table or view does not exist + CX_RS_SQL_ERROR

    HI ,
    we are facing below issue while activating info object xxxxxxxx
    " SQL Error: ORA-00942: table or view does not exist "  and   " CX_RS_SQL_ERROR  "
    can any one help us out to resolve this issue.
    Thanks,
    EDK......

    Hi,
    Check the corrections given in the note 990764:
    Reason and Prerequisites
    Up to now, using a characteristic with its own master data read class as the InfoProvider was not supported. This is now released but it is not available for all modelings. Using the attributes in the query is not supported for characteristics that have their own master data read class. Using the attributes in the query causes a termination. The following errors may occur in this case:
    ORA-00942: table or view does not exist
    Fehler in CL_SQL_RESULT_SET  Include NEXT_PACKAGE
    RAISE_READ_ERROR in CL_RSDRV_VPROV_BASE
    Solution
    SAP NetWeaver 2004s BI
               Import Support Package 11 for SAP NetWeaver 2004s BI (BI Patch 11 or SAPKW70011) into your BI system. The Support Package is available once Note 0914305 "SAPBINews BI 7.0 Support Package 11", which describes this Support Package in more detail, has been released for customers.
    In urgent cases you can implement the correction instructions.
    The correction instructions contain the tightened inspection for characteristics.
    Regards,
    Anil Kumar Sharma .P

  • Error ORA-01002: fetch out of sequence

    Hi all,
    I created 3 cursors. The scenario is like following :
    Begin Cur A
    Begin FOR xx IN Cur B LOOP
    Begin FOR xx IN Cur C LOOP
    End LOOP Cur C;
    commit;
    End LOOP Cur B;
    End Cur A;
    When i run the program its display error ORA-01002: fetch out of sequence.
    The objective of my program is to insert into table and commit every transaction.
    Kindly share info with me why this error happened.
    TQ.
    tim

    Tim,
    Refer to the following:
    ORA-01002: fetch out of sequence
    Cause: This error means that a fetch has been attempted from a cursor which is no longer valid.
    Note that a PL/SQL cursor loop implicitly does fetches, and thus may also cause this error. There are a number of possible causes for this error, including:
    1) Fetching from a cursor after the last row has been retrieved and the ORA-1403 error returned.
    2) If the cursor has been opened with the FOR UPDATE clause, fetching after a COMMIT has been issued will return the error.
    3) Rebinding any placeholders in the SQL statement, then issuing a fetch before reexecuting the statement.
    Action:
    1) Do not issue a fetch statement after the last row has been retrieved - there are no more rows to fetch.
    2) Do not issue a COMMIT inside a fetch loop for a cursor that has been opened FOR UPDATE.
    3) Reexecute the statement after rebinding, then attempt to fetch again.
    HTH,
    Thierry
    Edited by: Thierry H. on May 4, 2011 12:30 PM Reformatting

Maybe you are looking for