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".

Similar Messages

  • 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.

  • 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>

  • Oracle OUTER JOIN on more than one table

    Hi!
    Friends, please help with this urgent problem: How can an outer join be written on more than one table?
    An SQL Server query:
    SELECT * from a INNER JOIN b on a.id = b.id LEFT OUTER JOIN c ON c.id = a.id AND c.id = b.id
    works fine with SQL SERVER
    But Oracle query:
    SELECT * from a,b,c WHERE a.id = b.id AND a.id = c.id (+) AND b.id = c.id (+)
    gives an error: OUTER JOIN cannot be used on more than one table? Why?
    I use OracleDriver from classes12.zip to connect to Oracle8i database.
    Please, help!

    The Oracle 8i and later SQL reference reads that the following "join_types" are supported and under this syntax it does not limit the LEFT OUTER JOIN (syntax the same as SQLServer example in original note) to two tables as implied in these notes:
    The join_type indicates the kind of join being performed:
    Specify INNER to indicate explicitly that an inner join is being performed. This is the default.
    Specify RIGHT to indicate a right outer join.
    Specify LEFT to indicate a left outer join.
    Specify FULL to indicate a full or two-sided outer join. In addition to the inner join, rows from both tables that have not been returned in the result of the inner join will be preserved and extended with nulls.
    You can specify the optional OUTER keyword following RIGHT, LEFT, or FULL to explicitly clarify that an outer join is being performed.

  • How to use left outer join on more than one table (source)

    Hi all,
    In our project we are converting the Unix shell & SQL scripts into OWB mappings. We are facing problem converting left outer join in OWB. here is one of the example. i have just pasted the FROM and where condition.
    FROM ym_scr t1, branch_finmonth t3
    LEFT OUTER JOIN item_image t2
    ON (t1.branch_no = t2.branch_no
    AND t1.item_no = t2.item_no
    AND t3.to_date between t2.tran_dt and t2.to_dt
    AND t2.to_dt >= '$start_images' ) <<<========= '$start_images' THIS COMES FROM THE UNIX VARAIBLE ,
    We converts the same when we are putting it in OWB join Operator
    INGRP1.branch_no = INGRP2.branch_no(+)
    AND INGRP1.item_no = INGRP2.item_no(+)
    AND INGRP3.to_date between t2.tran_dt and t2.to_dt
    AND INGRP2.to_dt >= INGRP2.start_images
    But as you see in the OWB opreator we can put left join with INGRP1 with INGRP2.
    We can not make same join with INGRP3 & INGRP4 , becoz it failed saying "you cannot left outer join on more than one table/source".
    so overall this OWB code makes incomplete left outer join as per the above ANSI SQL join in Oracle.
    Bcoz of the problem we are getting less number of rows...........
    SO please please help me on this
    Regards
    Ashok

    Hi.
    I know this topic is here for a while now, but I had the same problem today, searched for help and didn´t find anything.
    Later I figured out how to do this.
    You just have to put the (+) one time, and the OWB converts in an LEFT OUTER JOIN statement.
    For this case, all you have to do is:
    ( INGRP1.branch_no = INGRP2.branch_no(+) AND INGRP1.item_no = INGRP2.item_no AND INGRP2.to_dt >= INGRP2.start_images )
    Regards,
    Godoy

  • ORA-22922: nonexistent LOB value in outer join in XMLDB parsing query

    Hi,
    We are in a situation where i must use outer join with the address type fragment in the XML reader query,
    Here is the oracle installation details
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    PL/SQL Release 11.2.0.3.0 - Production
    "CORE     11.2.0.3.0     Production"
    However once i add the (+) sign i get an error, other wise it runs absolutely fine without the (+) s
    ORA-29400: data cartridge error
    ORA-22922: nonexistent LOB value
    29400. 00000 - "data cartridge error\n%s"
    *Cause:    An error has occurred in a data cartridge external procedure.
    This message will be followed by a second message giving
    more details about the data cartridge error.
    *Action:   See the data cartridge documentation
    for an explanation of the second error message.
    Query:
    =======
    select
    from PWAYWORKFILE_TABLE,
    xmltable(
    xmlnamespaces(DEFAULT 'http://www.cccis.com/Pathways/Workfile'
    , 'http://www.cccis.com/Pathways/CommonType' as "pct")
    , '$XS/PwayWorkfile' passing WORKFILE as "XS"
    columns
    CURESTID VARCHAR2 (4000) PATH 'EstimateComp/LastOutboxEstID',
    Est_Fragment XMLTYPE PATH 'EstimateComp/EstList/VehEstimate'
    ) m,
    XMLTABLE(
    xmlnamespaces(DEFAULT 'http://www.cccis.com/Pathways/Workfile'
    , 'http://www.cccis.com/Pathways/CommonType' as "pct")
    , '$PY/VehEstimate' passing m.Est_Fragment as "PY"
    columns
    NUMBERLINES VARCHAR2 (4000) PATH '@NumberLines',
    LINEESTIMATEID VARCHAR2 (4000) PATH 'EstimateID',
    EstLine_Fragment XMLTYPE PATH 'EstimateLines/EstimateLine'
    ) (+) l,
    XMLTABLE(
    xmlnamespaces(DEFAULT 'http://www.cccis.com/Pathways/Workfile'
    , 'http://www.cccis.com/Pathways/CommonType' as "pct")
    , '$NY/EstimateLine' passing l.EstLine_Fragment as "NY"
    columns
    LINENUMBER VARCHAR2 (4000) PATH '@LineNumber',
    LINEBLOCKID VARCHAR2 (4000) PATH 'LineBlockID',
    LABORCATEGORY VARCHAR2 (4000) PATH 'LaborCategory',
    LABORHOURS VARCHAR2 (4000) PATH 'LaborHours',
    LINEOPERATION VARCHAR2 (4000) PATH 'LineOperation',
    MANUALLABORINCLUDE VARCHAR2 (4000) PATH 'ManualLaborInclude',
    MANUALPAINTINCLUDE VARCHAR2 (4000) PATH 'ManualPaintInclude',
    MANUALPRICEINCLUDE VARCHAR2 (4000) PATH 'ManualPriceInclude',
    OEMPRICE VARCHAR2 (4000) PATH 'Calculation/OEMPrice',
    SINGLEOHINCL VARCHAR2 (4000) PATH 'DataList/DBMotorData/LaborInclType/@SINGLEOHINCL',
    DOUBLEOHINCL VARCHAR2 (4000) PATH 'DataList/DBMotorData/LaborInclType/@DOUBLEOHINCL',
    PPAGEINCL VARCHAR2 (4000) PATH 'DataList/DBMotorData/LaborInclType/@PPAGEINCL',
    SUPPLIERID VARCHAR2 (4000) PATH 'DataList/RPSPart/SupplierID'
    ) (+) j
    where
    l.LINEESTIMATEID = 51 or
    l.LINEESTIMATEID = m.CURESTID or
    l.LINEESTIMATEID = (CASE
    WHEN m.CURESTID = 101 THEN 51
    WHEN m.CURESTID > 101 THEN m.CURESTID -1
    ELSE -1 END);
    Please note that the PWAYWORKFILE_TABLE is objection relationally stored with XMLs.
    Please suggest what kind of error i am getting and what possible steps might resolve the same, let me know if i missed any details which might shade more light on the same.
    Regards,
    Arghyadip

    Which outer join gives you the error? I don't see any address information in the SQL, hence my question. The first outer join, on table alias L is not needed. The WHERE clause you have setup requires that L.LINEESTIMATEID has a value and so NULL will not evaluate to TRUE and the row will be filtered out. This means you will only be returning rows where there exists rows in the L table, hence the outer join is not needed.
    Are all your columns really VARCHAR2(4000)? You say it is object-relational, but was something defined as a CLOB?
    You did not provide much in order to duplicate your error so I am just guessing at causes to identify the error.
    Also see #9 in
    {message:id=9360002}

  • How to use outer join on 2 tables with Oracle 8i

    Could anyone tell me the Oracle 8i syntax equivalent to :
    select user.name, city.adress, contry.name
    from user
    left outer join city on (user.rCity = city.code)
    left outer join country on (user.rCountry = country.code)
    I tried following :
    select user.name, city.adress, contry.name
    from user, city, contry
    where user.rCity (+) = city.code
    and user.rCountry (+) = country.code
    but displayed following error :
    ORA-01417: a table may be outer joined to at most one other table
    Thank you

    Logically I would expect a user to have a city and a country, or not. In that case the outer join should be on the other tables. Making your query:
    select user.name, city.adress, country.name
    from user, city, country
    where user.rCity = city.code (+)
    and user.rCountry = country.code (+);

  • Oracle outer join on  multiple tables throws error

    Hi ,
    We are using ansi joins with outer joins on multiple tables in oracle 9i.
    Now these queries have to be used in Oracle8i.
    Since Oracle8i does not support ansi sql we are replacing the ansi sql queries with the oracle joins.
    On trying the same we found that the following query
    select *from tab1 a, tab2 b, tab3 c where a.c1 = b.col1(+) and c.c2 = b.col2 (+)
    throws the error
    ORA-01417: a table may be outer joined to at most one other table.
    Is there a way to simulate this query without using the outer joins on multiple tables?
    thanks

    Try writing the query in this form:
    select * from
    (select t1.col1, t1.col2
    from schema.table1 t1, schema.table2 t2
    where t1.col1 = t2.col1(+)) t4,
    schema.table3 t3 where t4.col2 = t3.col2(+)
    In the subquery, you will have to list all the columns you want to see, and you will need to provide unique aliases for any columns with duplicate names. I tested this on 9i, and don't have an 8i system to work with, so I hope this helps.

  • Left Outer Joining multiple tables to one source table FAILS with VLD-1511

    Hi all,
    Is it me, or is OWB unable to handle left outer joining 1 source table to multiple other tables?
    I want to load a fact table so I have 1 source table with measures. This table must be outer joined to some dimensions that have their FK in the fact table.
    The SQL statement would look like this (and is perfectly valid):
    select ...
    from input, dim1, dim2
    where input.c1 = dim1.c1(+)
    and input.c2 = dim2.c2(+);
    I put the where clause in the joiner operator and validate, but that gives me message VLD-1511: A table may be outer joined to at most one other table.
    Even splitting this up into one outer join per joiner still gives this message.
    A search and look around on the forum and on metalink shows there are related issues (like bug 3334035). Seemingly creating a view is the work-around to use.....? (ie downgrading owb to a simple gui tool) }-;
    Have other people experienced this problem of not being able to outer join one input table to multiple other tables?
    Thanks,
    Ed

    I have had some feedback from Oracle. It turns out this has to do with 2 issues. Below I have pasted the text that Support gave me:
    <---------- START QUOTE ---------->
    RESEARCH
    =========
    Bug 3437036 KEY LOOKUP DOES NOT DETECT ORA-1417 IN VALIDATE/GENERATE STEP
    Unpublished Bug 4211684 FORWARD PORT OF BUG 3437036
    shows:
    Some more development has been completed when this bug is fixed in Paris.
    The following are the details:
    1. If the join condition contains a full outer join such as
    tab1.c (+) = tab2.c (+) and tab2.c (+) = tab3.c
    then the new validations implemented for this bug do not apply since
    in OWB, full outer join triggers generation of joins in ANSI syntax.
    ANSI syntax does not have the original problem the base bug of this
    bug reported.
    2. If the join condition does not contain any full outer join condition,
    then the join is generated in Oracle join syntax, which is subject two
    several restrictions. The fix to this bug check two of the restrictions.
    3. The first restriction in Oracle syntax is that the outer join operator
    "(+)" can only directly be attached to a column name. If you attach it
    to an expression, such as the following:
    (tab1.c + 1) (+) = tab2.c
    Then there will be an ORA-936 error at the time of mapping deployment.
    For this case, I have added a validation message VLD-1512 to error out
    this situation.
    4. The second restriction in Oracle syntax is that a table can only be
    outer joined to exactly one other table.
    For example, this is an invalid join in Oracle syntax:
    tab1.c (+) = tab2.c and tab1.d (+) = tab3.d
    because tab1 is left outer joined to tab2 and tab3.
    But note that the following is still valid in Oracle syntax:
    tab1.c (+) = tab2.c and tab1.d = tab3.d (+)
    because tab1 is left outer joined to tab2 and right outer joined to tab3.
    So this latter case does not violate the restriction that "same oj" to
    more than 1 table is not allowed.
    If same oj to more than 1 table is specified in a join condition,
    VLD-1511 will be issued, and the map is made invalid.
    <---------- END QUOTE ---------->
    OWB does a partial validation, ie not all access paths are (can be) checked. A full check is only done by the database itself. So some scenarios (like checking whether multiple tables are outer joined the correct way) are not checked, and in this case are flagged with an error (even though it is actually a correct scenario).
    Seemingly this was not flagged with an error in earlier versions of OWB, so beware, OWB behaviour may change when upgrading...
    Alternative solutions are (1) using key lookups, (2) using a view with all outer joins in there, (3) using intermediate result tables between the joins.
    Hope this info helps some people prevent spending too much time on a false error message,
    Ed

  • Translating SQL from MYSQL to ORACLE with more than one outer join.

    I will translate the following sqlquery from MYSQL to ORACLE:
    SELECT ticket.ticket_no,ticket.ticket_dato,ticket.ticket_subject,ticket.customer_id,customer_name,ticket.ticket_own_read, ticket.department_id, department.department_name, priority_name, tickstat_name, tickettype_name
    FROM customer, ticket left join department
    on ticket.department_id = department.department_id left join priority on ticket.priority_id = priority.priority_id
    left join ticketstatus on ticket.tickstat_id = ticketstatus.tickstat_id
    left join tickettype on ticket.tickettype_id = tickettype.tickettype_id
    where ticket.customer_id = customer.customer_id and customer.owner_id =
    #session.owner_id#
    I have tried in ORACLE with:
    SELECT ticket.ticket_no,ticket.ticket_dato,ticket.ticket_subject,ticket.customer_id,customer_name,ticket.ticket_own_read, ticket.department_id, department.department_name, priority_name, tickstat_name, tickettype_name
    FROM customer, ticket ,department, priority, ticketstatus, tickettype
    where
    ticket.department_id(+) = department.department_id and
    ticket.priority_id(+) = priority.priority_id and
    ticket.tickstat_id(+) = ticketstatus.tickstat_id and
    ticket.tickettype_id(+) = tickettype.tickettype_id and
    ticket.customer_id = customer.customer_id and customer.owner_id = #session.owner_id#
    I get an error:
    MERANT][ODBC Oracle driver][Oracle]ORA-01417: a table may be outer joined to at most one other table
    How do I translate the code to ORACLE?

    I think that your syntax is wrong. The (+) operator should be on the right hand table column, not the left hand table column if you want all rows on the left hand table column. If this syntax is really what you want, you can create underlying views for each join condiction.

  • ANSI SQL 92 SYNTAX OUTER JOIN PERFORMANCE ISSUE

    Good Morning
    Could anyone explain why the excution time for these two (ment to be identical)
    queries run so differently.
    oracle syntax execution time 1.06 seconds
    select COUNT(*) from
    PL_EVENT_VIEW pev,
    PL_EVENT_STAFF_VIEW pesv
    WHERE pev.EVENT_ID=PESV.EVENT_ID(+)
    AND pev.WEEKS=PESV.WEEK_NUM(+)
    AND pev.event_id=2520
    ansi sql 92 syntax execution time 7.05 seconds
    select COUNT(*) from
    PL_EVENT_VIEW pev
    LEFT JOIN PL_EVENT_STAFF_VIEW pesv
    ON (pev.EVENT_ID=PESV.EVENT_ID
    AND pev.WEEKS=PESV.WEEK_NUM)
    WHERE pev.event_id=2520
    Thanks
    David Hills

    BTW Oracle outer join operator (+) and ANSI SQL OUTER JOIN syntax are NOT equivalent. Consider following:
    DROP TABLE T1;
    CREATE TABLE T1 (C1 NUMBER);
    DROP TABLE T2;
    CREATE TABLE T2 (C2 NUMBER);
    DROP TABLE T3;
    CREATE TABLE T3 (C3 NUMBER);
    -- Following SELECT works:
    SELECT COUNT(*)
         FROM T1, T2, T3
         WHERE C2 = C1
              AND C3(+) = C1
    COUNT(*)
    0
    -- But:
    SELECT COUNT(*)
         FROM T1, T2, T3
         WHERE C2 = C1
              AND C3(+) = C1
              AND C3(+) = C2
    AND C3(+) = C1
    ERROR at line 4:
    ORA-01417: a table may be outer joined to at most one other table
    -- However with ANSI syntax:
    SELECT COUNT(*)
         FROM T1
         JOIN T2 ON (C2 = C1)
         LEFT JOIN T3 ON (C3 = C1 AND C3 = C2)
    COUNT(*)
    0

  • Oute join

    How i can apply ANSI standared in i.e LEFT OUTER JOIN because in the query given below it's showing error
    SELECT NVL(uiq.question,ucq.question) as question,
    iqa.answer as answer,
    iqa.seperate_cover as reference_attached,
    iqa.attachment_extension as file_extension,
    iqa.filename as filename,
    addr.address_1 as attachment_address_1,
    addr.address_2 as attachment_address_2,
    addr.address_3 as attachment_address_3,
    addr.address_4 as attachment_address_4,
    addr.postcode as attachment_postcode,
    cty.description as attachment_country,
    iqa.upt_iqa_id as questionanswer.id
    FROM upt_iqa_questions_answers iqa,
    tpz_add_address addr,
    trf_cty_country cty,
    ukp_uiq_ins_question uiq,
    ukp_ucq_uic_question ucq
    WHERE iqa.upt_iap_id = <parameter primary key application>
    AND addr.tpz_add_id = iqa.tpz_add_id (+)
    AND cty.trf_cty_id = addr.trf_cty_id (+)
    AND uiq.ukp_uiq_id = iqa.ukp_uiq_id (+)
    AND ucq.ukp_ucq_id = iqa.ukp_ucq_id (+)
    ORDER BY iqa.position;

    Hello,
    I suppose that error message is ORA-01417 : a table may be outer joined to AT MOST ONE other table ?
    In this case, it means that you can not outer join iqa to addr, uiq and ucq.
    What is the meaning of your tables, and what data would you like to select ?

  • Outer joined

    Good Morning everyone,
    Technically, we are in Spring but I have a following snow storm.
    ORA-01417: a table may be outer joined to at most one other table
    Any help!
    Thanks,
    NY

    Hi,
    ~NYorker wrote:
    I would like to know about and reason to use left joined.
    What is ANSI format?ANSI join syntax allows you to easily do some things that require complicated sub-queries (if you can do them at all) otherwise. The ORA-01417 error you got is just one of many examples.
    Even when it doesn't dramatically reduce the amount of cioding, I find ANSI notation easier to read, understand and debug. Every time you specify a new table in the FROM clause, you have to specify a join condition (or CROSS JOIN); you don;'t have to hunt through a distant WHERE clause to find join conditions.
    Look for "join clause+ in the documentation for the SELECT statement:
    http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/statements_10002.htm#i2080416
    Any good introductory text for Oracle 9 (or higher) will have a description and examples.

  • 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

  • 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.

Maybe you are looking for

  • Special character in receiving file

    hi everyone. i have implemented file to file scenario. I am getting file at my receiving end. IN my receiver CC i have mentioned endSeparator as 'nl' , but when file gets created it shows special charater (box shaped) separating each record. any idea

  • FTP can access through URL?

    Hello All, My client wants to access the FTP server through URL. Which adapter i need to use FILE or SOAP to send or receive the data. Thanks and Regards, chinna

  • Images on a website don't show, while they do in Safari

    This webpage shows a bunch of small graphics, connected by lines. The content does not show at all in Firefox 4 and the problem started showing in the last two Firefox 3 updates. Safari loads the page no problem. I do use the noscript plugin, but the

  • Cs3 preview looks good but won't display some pictures online.

    Using cs3.  My pages work fine in display but some .gif and .jpeg won't display once published.  Same in ie and mozilla.  http://www.cinnamonridgehomes.com/homeplans.html  Any ideas?

  • MM period opening/closing

    Hi folks, In MMPV,user has been closed the current period 09/2009 and initiated for 10/2009 and 11/2009 . Is there a way to change the entry back to 09/2009 in any tables or through any configuration. Regards, Deepak.