And , or in outer join

dear all,
since the column of table can not be boolean value, so why and can be used in join query, why "or" can not? anybody can give some example whether "and", "or" used in outer join is correct or wrong.
thanks,

hai lily...
yes i have tried this example
in outer join,yes it is correct,if we want
srpecific data then we can use these
parameters ....
hope u get it..
bye

Similar Messages

  • Infoset doc no. and item  data  Outer Join  Problam

    HI Gurus,
    I am using infoset based on 2 ODS 0figl_o02 and 0fiap_o03 for queiry.
    I have a requirment like ...
    0fiap_o03
    doc no. item   amount   vendor
    3333        1    10000 101
    3333        2    20000 101
    0figl_o02
    doc no. item amount
    3333        1    10000
    3333        2    20000
    3333        3    30000
    3333        4     40000
    3333        5    50000
    Now data required in Infoset
    doc no. item amount vendor
    3333        1    10000 101
    3333        2    20000 101
    3333        3    30000 101
    3333        4     40000 101
    3333        5    50000 101
    i am currently join it with company code and doc no.
    plz provide me your input to get above data in infoset.
    null
    Message was edited by:
            SSMS
    Message was edited by:
            SSMS
    null

    Thanks Phani,
    I joined item and did outer join.
    data is not coming as required.
    is that the way to apply outer join.????
    Message was edited by:
            SSMS

  • Mixed Inner and Outer Joins in One SQL

    Oracle 11g.
    There are four tables:
    T1 (primary key: pk_t1)
    T2 (primary key: pk_t2, foreign key fk_t2_ref_t1)
    T3 (primary key: pk_t3, foreign key fk_t3_ref_t2)
    T4 (primary key: pk_t4, foreign key fk_t4_ref_t3)
    This is what I want to do:  inner join among T1, T2, and T3, then outer join with T4 (T4 may contain the null rows).  Something like:
    procedure sp_test(
    p_where_clause)
    select *
    from
         T1 inner joint T2 on pk_t1 = fk_t2_ref_t1
        inner joint T3 on pk_t2 = fk_t3_ref_t2
        left outer join T3 on pk_t3 = fk_t4_ref_t3
    where  p_where_clause;
    OR
    select *
    from
         T4 right outer join T3 on pk_t3 = fk_t4_ref_t3
        inner joint T2 on pk_t2 = fk_t3_ref_t2
        inner joint T1 on pk_t1 = fk_t2_ref_t1
    where  p_where_clause;
    Please help me to write a correct SQL to achieve this goal.
    Thanks

    Hi,
    Whenever you have a problem, please post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) from all tables involved, so that the people who want to help you can re-create the problem and test their ideas.
    Also post the results you want from that data, and an explanation of how you get those results from that data, with specific examples.
    Always say which version of Oracle you're using (for example, 11.2.0.2.0).
    See the forum FAQ: https://forums.oracle.com/message/9362002
    I'm guessing that your first attempt
    select *
    from
         T1 inner joint T2 on pk_t1 = fk_t2_ref_t1
        inner joint T3 on pk_t2 = fk_t3_ref_t2
        left outer join T3 on pk_t3 = fk_t4_ref_t3
    where  p_where_clause;
    was close; only you want to include t4 rather than a second copy of t3, and you need to spell JOIN correctly:
    SELECT  *        -- You'll probably want to specify columns
    FROM             t1
    INNER JOIN       t2     ON  pk_t1 = fk_t2_ref_t1
    INNER JOIN       t3     ON  pk_t2 = fk_t3_ref_t2
    LEFT OUTER JOIN  t4     ON  pk_t3 = fk_t4_ref_t3
    WHERE  ...

  • OBIEE not applying outer join syntax to filters

    (Note: I've already thoroughly searched the forums before posting this. Thanks)
    My problem is the following:
    I'm trying to build a report that is a count from my fact table, grouped by month from my date dimension for a given year, resulting in 12 data points. The problem is that not all months have actual data, but I still need those months to show on the report with a count of zero. Typical simple reporting requirement.
    I have already done the obvious and within my business layer made the join between my fact table and my date dimension an outer join on the fact side, just like you'd do if writing the query by hand. And when tested by hand this includes all dates for the year anyway, and when coupled with the appropriate null test on the count measure I'd get my 12 data points with zeros were appropriate.
    The problem is that there are additional filters I need to apply on the fact data (there are a couple text-based code values that didn't warrant full tables themselves so are just degenerate dimensions directly on the fact table.)
    When these filters are applied at the Answer level, I'm only getting back the months that actually have data, and lose the months where the count should be zero. A check of the session log for the query that was generated shows the problem. While OBI properly generates the outer-join syntax for the join itself between the two tables (my date dim and fact table) it does NOT apply the outer-syntax to the constant-based filter against the fact, effectively negating the outer join.
    Actual query from the log (I simply changed the table aliases from the ugly T##### stuff OBI generates to something more readable for posting here):
    select D.DT_MONTH_NAME as c1,
    D.DT_MONTH_NUM as c2,
    I.INC_TYPE as c3,
    I.INC_EMP_GROUP as c4,
    sum(case when I.INC_KEY is null then 0 else 1 end ) as c5
    from DATE_DIM D, INCIDENT_F I
    where ( D.DATE_KEY = I.DATE_KEY (+) ) and ( D.DT_YEAR = 2010 and I.INC_EMP_GROUP = 'CONTRACTOR' )
    group by D.DT_MONTH_NUM, D.DT_MONTH_NAME, I.INC_TYPE, I.INC_EMP_GROUP
    order by c2
    You can see that the outer syntax (+) is applied to the join, but not to the filter on I.INC_EMP_GROUP. If I take this query and drop it in something like SQL Developer, it only returns the months with data. If I throw the (+) after I.INC_EMP_GROUP like I'd do if writing this by hand, the desired zero-months results pop back in.
    I have already searched the forums and while lots of people seem to have asked this question, the only solutions involve things like trickery in the business layer using dummy fact tables followed by manipulations at the report level etc. Unfortunately I can't rely on these as the system is eventually to be turned over to users who can't be expected to apply various hacks to write reports.
    Anyone ever get to the bottom of getting OBI to apply outer join logic in filters as well, when the filtered table is meant to be outer-joined to?
    Any comments are appreciated.
    John

    I know that this thread is a bit old thought it might be helpful to some one...
    The Issue is, when using Degener@teDimen$ion ( this is !nner joned to FACT tables in BMM) and if any of the dimensions {other than theDegener@teDimen$ion (Let us say Dim X) } have an ()uter join to any of the fact tables, and you were doing your analysis using Degener@teDimen$ion,  Dim X, Measure value you will face the following issues.
    when filtering the analysis on the ()uter join dimension ( Dim X), the IN filter will not work. Reason is that the filter is getting applied to both the Dimension and FACT tables and the values that exist in Dimension Dim X but not in FACT table wont show up.
         The above issue can be fixed by changing the join between the fact and Degener@teDimen$ion from inner to outer. I think this is a bug.. because  it is supposed to filter the fact  table after the entire outer joined result is obtained but not filter the fact table for the Dim X values and do a outer join. I think the BI should be intelligent enough.

  • Reg: Full outer join help pls

    hi friends,
    i have created the following query using full outer join
    pls help me.
    Thanks
    Rajesh
    Message was edited by:
    Rajesh.mani

    I'm not sure if there should be a AND before FULL OUTER JOIN clause. I've always been reluctant to use ANSI syntax. here you can check the actual syntax. Bu then, from now on, try to keep quote your query between [pre] and [/pre] tags to preserve the format.
    Cheers
    Sarma.

  • 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

  • Outer join with tow columns foreign key

    If I want to select from two tables (A and B) with outer join on table "B" and I have two columns foregn key between the two tables what is the correct way:
    1)
    ...from A,B
    where A.key1 = B.key1 (+)
    and A.key2 = B.key2 (+)
    2)
    ...from A,B
    where A.key1||A.key2 = B.key1||B.key2 (+)
    thank you,
    ENdre

    #1

  • Datawindow graphical syntax outer join BUG

    Ok, so this is a bug report.  I don't know where i'm supposed to post it for SAP (i do have support).
    The outer join syntax is ansi.
    Using the graphical SQL designer, outer joins are incorrectly written by powerbuilder.  This has been going on ever since ANSI style outer join sytax was added (PB 9?).
    I think it has to do with the datawindow's use of both right and outer joins and its lack of use of inner joins.  The end result is that we have to rewrite a lot of stuff in sql since powerbuilder is generating bad sql.
    The typical example is the use of 2 or more outer joins where the joins are being done using 2 or more columns.
    PB will create both a LEFT and a RIGHT outer join by duplicating the table name.  The table (receive) is only selected ONCE in the sql graphical designer.
    And this is the result:
    Microsoft SQL Native Client
    The objects "receive" and "receive" in the FROM clause have the same exposed names. Use correlation names to distinguish them.
    Do you want to correct errors?
    I would love to see the datawindow sql corrected and written in a more standard way.
    1 change the OUTER JOIN syntax in the db profile setup to indicate the syntax.  not outer join, but syntax.  If you select ANSI have it write ALL joins using JOIN ( from ta join tb on ta.col = tb.col) intead of from tablea, tableb where tablea.col = tableb.col
    2 - eliminate the use of right outer joins.
    At that point i believe that the datawindow could more easily be fixed by SAP to not duplicate tables when in generates the syntax.

    If you have an Oracle Support agreement you can log a Service Request with Oracle, but they may respond that it is not really a bug. The problem is that the "outer" keyword in your 3rd example is being treated as an alias for TABLE_A because it is not considered a reserved keyword.
    with table_a as (
    select 1 as id, 'abc' as value_a from dual union all
    select 2 as id, 'def' as value_a from dual union all
    select 3 as id, 'ghi' as value_a from dual
    , table_b as (
    select 2 as id, 'jkl' as value_b from dual union all
    select 3 as id, 'mno' as value_b from dual union all
    select 4 as id, 'pqr' as value_b from dual
    select ID, outer.VALUE_A, VALUE_B from TABLE_A outer join TABLE_B using (ID);
    ID                     VALUE_A VALUE_B
    2                      def     jkl
    3                      ghi     mnoIf you query the V$RESERVED_WORDS view it will tell you which keywords are reserved.
    select * from V$RESERVED_WORDS where keyword in ('OUTER', 'SELECT','USING');
    KEYWORD                        LENGTH                 RESERVED RES_TYPE RES_ATTR RES_SEMI DUPLICATE
    USING                          5                      N        N        N        N        N
    OUTER                          5                      N        N        N        N        N
    SELECT                         6                      Y        N        N        N        NYou would get a similar result if you tried
    select ID, VALUE_A, VALUE_B from TABLE_A using join TABLE_B using (ID);Regards,
    Bob

  • Diff "full outer join" va. "(+)" SELECT syntax ?

    As far as I know there are two ways of defining an outer join:
    Select ... from tab1 t1 full outer join tab2 t2 on t1.id =t2.id;
    or:
    Select ... from tab1 t1, tab2 t2 where t1.id = t2.id(+)
    Are they absolutely equivialent?
    Which are the most common one?
    Which are used on other databases (DB2, MySQL) as well?
    Can I put an additional WHERE clause at the end in the first statement:
    Select ... from tab1 t1 full outer join tab2 t2 on t1.id =t2.id WHERE .....;

    Select ... from tab1 t1 full outer join tab2 t2 on t1.id =t2.id;This is FULL OUTER JOIN
    Select ... from tab1 t1, tab2 t2 where t1.id = t2.id(+)This is LEFT OUTER JOIN.
    They are entirely different.
    FULL OUTER JOIN - Gets all the rows from tab1 and tab2
    LEFT OUTER JOIN - Gets all the rows from tab1 and only the row that matches with join condition from tab2.
    Here is a simple test.
    create table tab1(id integer)
    create table tab2(id integer)
    begin
      insert into tab1 values(1);
      insert into tab1 values(2);
      insert into tab1 values(3);
    end;
    begin
      insert into tab2 values(3);
      insert into tab2 values(4);
      insert into tab2 values(5);
    end;
    Select t1.id, t2.id
      from tab1 t1 full outer join tab2 t2
        on t1.id =t2.id
    Select t1.id, t2.id
      from tab1 t1, tab2 t2
    where t1.id = t2.id(+)
    /Run it and see the result.

  • Outer join, use in a query.

    Hi forum!
    I want to do a query among three tables keeping empties rows. Is this possible to do with an outer join?
    Could anybody give me an example how to use it¿?
    Thanks in advance and regards,
    Mon

    Yes you can use outer join for the same.
    In an inner join, a line from the left-hand database table or join is only included in the selection if there is one or more lines in the right-hand database table that meet the ON condition <cond>. <b>The left outer join, on the other hand, reads lines from the left-hand database table or join even if there is no corresponding line in the right-hand table.</b>
    SELECT ...
    FROM <tab> LEFT [OUTER] JOIN <dbtab> [AS <alias>] ON <cond> <options>
    <tab> and <dbtab> are subject to the same rules and conditions as in an inner join. The OUTER addition is optional. The tables are linked in the same way as the inner join with the one exception that all lines selected from <tab> are included in the final selection. If <dbtab> does not contain any lines that meet the condition <cond>, the system includes a single line in the selection whose columns from <dbtab> are filled with null values.
    In the left outer join, more restrictions apply to the condition <cond> than in the inner join. In addition to the above restrictions:
    EQ or = is the only permitted relational operator.
    There must be at least one comparison between columns from <tab> and <dbtab>.
    The WHERE clause may not contain any comparisons with columns from <dbtab>. All comparisons using columns from <dbtab> must appear in the condition <cond>.
    For details and examples of outer join please have a look at below links.
    http://help.sap.com/saphelp_nw04/helpdata/en/67/7e4b3eaf72561ee10000000a114084/content.htm
    http://database.ittoolbox.com/documents/popular-q-and-a/inner-and-outer-join-sql-statements-2108
    I hope it helps.
    Best Regards,
    Vibha
    *Please mark all the helpful answers

  • Equi join as well as outer join

    Hi all,
    I have two table. They have common fields case_id and issuer_id.
    I want to retrieve the data from two tables first based on case_id(equi join) and then issuer_id(outer join). The query like this
    select t1.case_id,t1.case_name,t2.issuer_name from case t1,issuers t2
    where t1.case_id=t2.case_id and t1.issuer_id=t2.issuer_id(+)
    The above query displays error
    so, My query first gets the data based on equijoin , then i want to apply outer join on that same tables.
    plz try to solve the above problem

    SQL> create table mycase
      2  as
      3  select 1 case_id, 'NAME1' case_name, 1 issuer_id from dual union all
      4  select 2, 'NAME2', 2 from dual union all
      5  select 3, 'NAME3', 3 from dual union all
      6  select 4, 'NAME3', 4 from dual
      7  /
    Tabel is aangemaakt.
    SQL> create table issuers
      2  as
      3  select 1 case_id, 1 issuer_id, 'ISSUER1' issuer_name from dual union all
      4  select 2, 3, 'ISSUER2' from dual union all
      5  select 3, 4, 'ISSUER3' from dual union all
      6  select 4, 6, 'ISSUER4' from dual
      7  /
    Tabel is aangemaakt.
    SQL> select t1.case_id,t1.case_name,t2.issuer_name from mycase t1,issuers t2
      2  where t1.case_id=t2.case_id and t1.issuer_id=t2.issuer_id(+)
      3  /
                                   CASE_ID CASE_ ISSUER_
                                         1 NAME1 ISSUER1
    1 rij is geselecteerd.The above query doesn't make sense: the outer join predicate says "if I don't find a matching issuer_id, Oracle please make up an entire null issuer record for this one". Then the other predicate says "t1.case_id=t2.case_id" where a null value for t2.case_id will never match t1.case_id and will be excluded from the result set. Effectively you could drop the plus sign in this query to achieve the same result.
    Maybe you want the query below?
    SQL> select t1.case_id
      2       , t1.case_name
      3       , case t1.issuer_id
      4         when t2.issuer_id then t2.issuer_name
      5         else null
      6         end issuer_name
      7    from mycase t1
      8       , issuers t2
      9   where t1.case_id = t2.case_id
    10  /
                                   CASE_ID CASE_ ISSUER_
                                         1 NAME1 ISSUER1
                                         2 NAME2
                                         3 NAME3
                                         4 NAME3
    4 rijen zijn geselecteerd.Regards,
    Rob.

  • Problem with XMLTABLE and LEFT OUTER JOIN

    Hi all.
    I have one problem with XMLTABLE and LEFT OUTER JOIN, in 11g it returns correct result but in 10g it doesn't, it is trated as INNER JOIN.
    SELECT * FROM v$version;
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    PL/SQL Release 11.2.0.1.0 - Production
    "CORE     11.2.0.1.0     Production"
    TNS for Linux: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production
    --test for 11g
    CREATE TABLE XML_TEST(
         ID NUMBER(2,0),
         XML XMLTYPE
    INSERT INTO XML_TEST
    VALUES
         1,
         XMLTYPE
              <msg>
                   <data>
                        <fields>
                             <id>g1</id>
                             <dat>data1</dat>
                        </fields>
                   </data>
              </msg>
    INSERT INTO XML_TEST
    VALUES
         2,
         XMLTYPE
              <msg>
                   <data>
                        <fields>
                             <id>g2</id>
                             <dat>data2</dat>
                        </fields>
                   </data>
              </msg>
    INSERT INTO XML_TEST
    VALUES
         3,
         XMLTYPE
              <msg>
                   <data>
                        <fields>
                             <id>g3</id>
                             <dat>data3</dat>
                        </fields>
                        <fields>
                             <id>g4</id>
                             <dat>data4</dat>
                        </fields>
                        <fields>
                             <dat>data5</dat>
                        </fields>
                   </data>
              </msg>
    SELECT
         t.id,
         x.dat,
         y.seqno,
         y.id_real
    FROM
         xml_test t,
         XMLTABLE
              '/msg/data/fields'
              passing t.xml
              columns
                   dat VARCHAR2(10) path 'dat',
                   id XMLTYPE path 'id'
         )x LEFT OUTER JOIN
         XMLTABLE
              'id'
              passing x.id
              columns
                   seqno FOR ORDINALITY,
                   id_real VARCHAR2(30) PATH '.'
         )y ON 1=1
    ID     DAT     SEQNO     ID_REAL
    1     data1     1     g1
    2     data2     1     g2
    3     data3     1     g3
    3     data4     1     g4
    3     data5          Here's everything fine, now the problem:
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bi
    PL/SQL Release 10.2.0.1.0 - Production
    "CORE     10.2.0.1.0     Production"
    TNS for HPUX: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    --exactly the same environment as 11g (tables and rows)
    SELECT
         t.id,
         x.dat,
         y.seqno,
         y.id_real
    FROM
         xml_test t,
         XMLTABLE
              '/msg/data/fields'
              passing t.xml
              columns
                   dat VARCHAR2(10) path 'dat',
                   id XMLTYPE path 'id'
         )x LEFT OUTER JOIN
         XMLTABLE
              'id'
              passing x.id
              columns
                   seqno FOR ORDINALITY,
                   id_real VARCHAR2(30) PATH '.'
         )y ON 1=1
    ID     DAT     SEQNO     ID_REAL
    1     data1     1     g1
    2     data2     1     g2
    3     data3     1     g3
    3     data4     1     g4As you can see in 10g I don't have the last row, it seems that Oracle 10g doesn't recognize the LEFT OUTER JOIN.
    Is this a bug?, Metalink says that sometimes we can have an ORA-0600 but in this case there is no error returned, just incorrect results.
    Please help.
    Regards.

    Hi A_Non.
    Thanks a lot, I tried with this:
    SELECT
         t.id,
         x.dat,
         y.seqno,
         y.id_real
    FROM
         xml_test t,
         XMLTABLE
              '/msg/data/fields'
              passing t.xml
              columns
                   dat VARCHAR2(10) path 'dat',
                   id XMLTYPE path 'id'
         )x,
         XMLTABLE
              'id'
              passing x.id
              columns
                   seqno FOR ORDINALITY,
                   id_real VARCHAR2(30) PATH '.'
         )(+) y ;And is giving me the complete output.
    Thanks again.
    Regards.

  • Problem with outer joins and the class indicator/discriminator

    Hello,
    I am having a problem defining a query in toplink (10.1.3.3).
    In the workbench, I have created a parent and 2 child descriptors. The parent is "AbstractValue", the children are "DefaultValue", classified by the discriminator 'DEF', and "OverrideValue", classified by 'OVR', both located in the same table.
    Another descriptor (containing a one-on-one mapping to both a "DefaultValue", and a "OverrideValue") needs to be queried for its 'value'.
    The way the query should act is: If an override value (row) exists, this one applies for that object. If an override doesn't exist, return the default value.
    The query then comes down to (as I have it now):
    builder.getAllowingNull("OverrideValue").getAllowingNull("value").ifNull(builder.get("DefaultValue").get("value")).equal(builder.getParameter(VALUE_PARAM));
    The problem is that toplink adds the distinction for the different kind of "values" in the where clause WITHOUT checking for null values e.g. it performs an outer join, but then still checks for the discriminator value thus
    ....t1.ovr_id = t2.id(+) AND t2.discriminator = 'OVR' AND ...
    instead of
    ... LEFT JOIN values t2 ON (t1.ovr_id = t2.id AND t2.discriminator = 'OVR') ...
    This leads to the behaviour that the query returns ONLY the objects that have override and default values.
    An overview of the queries (simplified)
    Toplink, at the moment, returns only results if both override and default values exists:
    SELECT t1.id
    t1.def_id,
    t1.ovr_id
    FROM values t2,
    parameter t1,
    values t0
    WHERE nvl(t2.value, t0.value) = 15 AND
    t1.ovr_id = t2.id(+) AND t2.discriminator = 'OVR' AND
    t1.def_id = t0.id AND t0.discriminator = 'DEF'
    Situation Wanted:
    SELECT t1.id
    t1.def_id,
    t1.ovr_id
    FROM parameter t1
    LEFT JOIN values t2 ON (t1.ovr_id = t2.id AND t2.discriminator = 'OVR')
    JOIN values t0 ON (t1.def_id = t0.id AND t0.discriminator = 'DEF')
    WHERE nvl(t2.value, t0.value) = 15
    Anyone know if there is some statement I am missing to allow an actual outer join on descriptors containing class indicators/discriminators? A possible rewrite?
    Thanks in advance,
    Rudy

    This is a bug in TopLink's outer join support for Oracle. Currently the outer join is put in the where clause, instead of the from clause, as we do on other platforms. You might be able to fix it by changing your OraclePlatform to return false for shouldPrintOuterJoinInWhereClause().
    Please log this bug on EclipseLink, or through Oracle technial support.
    There is a workaround using,
    descriptor.getInhertiancePolicy().setAlwaysUseOuterJoinForClassType(true);
    James : http://www.eclipselink.org

  • Left Outer Join with more than two tables in both CR 8.5 and XIR2

    I am trying to create a report and I have tried two versions of Crystal but I ultimately need the report in CR8.5 for compatibility with the client's system.  I think I am starting to figure out what might be wrong and it might be my understanding of SQL, but I can't see why someone hasn't needed this in the past. Ultimately I want to see all projects and any journal entry that might be posted for that project.
    Database is MySQL 5.0.38 and using MySQL ODBC driver 3.51.19.
    Project header table information will be populated. Each line item on a journal entry can be tagged with the project ID. But for me to pull the journal entry date I need also to link to a third table for the journal entry header info.
    I want to see all projects, whether a journal entry has been posted or not.
    So the links are like this
    ProjectHeader --->Left Outer Join ---> JELines ---> Inner Join ---> JEHeader
    I think in this scenerio Crystal is treating the LOJ as an IJ.
    I created two brand new reports today, one in CR8.5 and one in CR XIR2. Once I edited the automatic CR8.5 SQL statement (which I have been doing for years, usually without problem), they both ran properly. I linked customers to their invoices. Customers without invoices showed properly. But then I linked the invoices to the payments of the invoices and immediately lost customers without orders in both reports.
    So apparently only two tables are allowed in Outer Joins. Does this make sense?  I checked out the w3schools tutorial on SQL and it doesn't mention this limitation and I can't find anywhere else that it specifically indicates this but all samples of code I have seen only show two tables.  I just thought for presentation as a sample that was easiest to understand and we could expand as necessary.
    If this is correct, how does one go about accounting for this kind of thing?  One solution that goes through my mind is creating a view at the database level for the link between journal entry lines and journal entry headers.  Would this be a good solution under normal circumstances?
    A second option that I had to implement because of timelines, is to use a subreport linked to the main report through the project ID to pull the information for the journal entries and just pass the totals I need to the main report through a shared variable.
    These aren't normal circumstances because I don't have access to the database so I can't create the view.  I have come across this concept several times and I have been able to use subreports to solve it but I am trying to find a better solution for the future as sometimes subreports can be slow.  So are there any alternatives I have not considered here?
    TIA rasinc

    So after some more work and another post.  I was able to get this to work.
    Items disappear when linking to another table
    My issues were two fold.  I was selecting on the tables on the right-side of the original Inner Join.  However, I was checking for Nulls.  This apparently is correct but you must check for the Nulls first eg. (IsNull (JEHeader.Field1) OR JEHeader.Field1 <= 100).  I had my original statement reversed checking for <= 100 before checking for Nulls.
    I also did not set all links to be Left Outer Join.  I had the Inner Join.  I actually have about 6 tables in this report so all the links need to be set Outer Join.  So this now seems to be corrected.
    Thanks

  • Dynamic From statement in select query and/or outer join not working

    Dear Experts, I have a select query where the select columns are dynamic, the where condition is also dynamic. It is of the below format:
    Select (dynamic columns) INTO <wa>
    FROM a inner join b on af1 = bf1
    inner join c on af2 = cf2......
    WHERE (dynamic conditios)
    ORDER BY ( dynamic sort condition).
    Now I have to include some tables (dynamically depending on the user input) in the inner join statement which will give description for the selected fields. And these database tables may or may no be empty. So in this case, my select query will not return any data if these tables are empty. And I dont want that.
    I tried using outer join for the extra tables but it gave me a runtime error. I also tried forming the inner join statement dynamically but it was not supporting.
    Kindly give me pointers.
    Thanks

    Hey thanks for the reply, but the problem is not solved.
    I am already using  ( fileds, value) like table in my where condition and the select statement was working properly.
    the problem is that now I have to include some tables in the join statement which can be empty and so i want to use Outer join.
    But I am getting a runtime error as below:
    Error analysis
        An exception occurred that is explained in detail below.
        The exception, which is assigned to class 'CX_SY_DYNAMIC_OSQL_SYNTAX', was not
         caught in
        procedure "ZATSCSNG_RFC_READ_TABLE" "(FUNCTION)", nor was it propagated by a
         RAISING clause.
        Since the caller of the procedure could not have anticipated that the
        exception would occur, the current program is terminated.
        The reason for the exception is:
        The running ABAP program wanted to execute a SELECT statement whose
        WHERE condition was (partly) specified dynamically. The part that is
        specified in an internal table at runtime is compared to a field of the
        right table of an LEFT OUTER JOIN. Such comparisons are not supported by
         all database systems and are therefore not allowed.

Maybe you are looking for

  • Error while running the sql queries in unix as cron job..

    Hi, I've configured some sql queries to run as cronjob from unix,i'm able to excute all the sql queries with out any error,after all the queries are executed,I'm getting the following error message. ORA-00600: internal error code, arguments: [4080],

  • How to cut, copy and paste a tree node in JTree?????

    Hi, Java GUI guru. Thank you for your help in advance. I am working on a File Explorer project with JTree. There are cut, copy and paste item menus in my menu bar. I need three EventAction methods or classes to implements the three tasks. I tried to

  • Interface name in Adapter module

    Hi Gems,     In my adapter module , i have a bean class and an other class extends AbstractTransformation with transform method.     public void transform(TransformationInput in, TransformationOutput out) throws StreamTransformationException {       

  • Windows Server 2012 CA will not allow Windows XP to autoenroll

    I have a Windows Server 2012 Domain Controller with an Enterprise root CA installed.  I have created a client authentication certificate template (2003 compatible).  Domain Computers have Read, Enroll and Autoenroll permissions.  I modified the Domai

  • YouTube Built-in app on iPad 2 doesn't allow sharing to Facebook?

    When I purchased my iPad 2, it was to use this for Facebook, YouTube, and twitter. On the appe website it says, "When you find a YouTube video your friends just have to see, tap Share on any YouTube video detail page. iPad creates an email with the v