Conditions on Outer Joined Tables

I'm trying to understand how Discoverer handles conditions created on outer joined tables. We're using Discoverer Plus 11.1.1.3.
I have a query using two tables connected by an outer join. While I want all records back from the first table, I don't want all records back from the outer joined table. So, if I typed the SQL directly in a SQL Editor, I would put the '(+)' in each condition. However, I find that in Discoverer, sometimes it does this, and sometimes it doesn't. If it does not put the '(+)' on all conditions as well as the join, that essentially nullifies the outer join and makes it an standard join.
For example, I expanded an item on the outer joined table in the Items dialog to see its list of values, and selected one, to add the column to the worksheet and create a condition. No (+). But when I deleted this and created the condition using the Condition dialog, I got a (+). Then I created another condition using the condition dialog. I used the IN operator and pasted in a list (this item had no item class to choose from)--no (+).
When I tried manually adding (+) after the item name in the condition dialog, it put quotes around the whole thing and treated it as a string.
I can find nothing in the documentation that discusses this. Is is possible to control whether or not it uses the (+)?
Thank you, Scott Newman

Dear Michael,
Last night I had a call from user who was experiencing a very strange behaviour of her Discoverer workbook.
I replicated the issue on my machine and could not believe my eyes. A condition on an item was being ignored. I then analysed the workbook and realised it was due to a condition on an item from an outer-joined folder. I did not have the strength after a long day to deal with it and was looking forward to having some fun the next day. Firstly, I tried few tricks such as NVL, LENGTH functions in a test query in Toad. I hate to give up but I did and searched threads on this forum and opened few. The very first thread I read was this one and I laughed when I read your advice. Only until the moment I tested it in the troubled workbook. It worked like a charm. I take my hat off to you Michael. I have rarely experienced such a satisfaction when solving a tricky problem during my 9-year-long Oracle Discoverer journey. This goes straight to my little text file with interesting problems and solutions.
Thank you very much. I owe you a beer or two.
It is great to have an expert like you, always ready to share his knowledge with his colleagues.
P.S.
My apologies for this massive post, I could not resist expressing my joy and gratitude.
Jozef Hlavaty

Similar Messages

  • Illegal selection by InfoObject from outer join table

    Hi all,
    in any infoset with left-outer-join, when i want to select any field (infoobject) to get exlude conditions i got these errors:
    illegal selection by InfoObject from outer join table.
    error reading the data of infoprovider '*'.
    thanks in advance .
    HS

    Hi Dorota,
    Choudhary S was right.
    İ have notified the SAP about this issue..they wrote me below note :
    As SAP tables have no concept for NULL, we
    have to restrict this condition to not allow excluding condition to be
    used any more. But alternatively, you could use including to replace it.
    Please check my last reply to see the detailed reason for it, and
    this explaination is from our development colleagues.
    For this note 1435772, you could also see why this error message
    arises.
    So, they said it is not possible in case of left outer join after those patches.
    i just used  include to replace that exluding condition.it takes little time but the problem is solving.
    Thanks
    HS

  • How do I find missing entries in outer join table?

    Hi all,
    I am trying to find records in table1 that are missing in table2.  This is a simple process in SQL, but ABAP is giving me trouble.  I want to do this using an outer join.
    Example:
    Select table1~docnumber
    From table1
    Left Outer Join table2
    On table1docnumber = table2docnumber
    Where table2~docnumber IS NULL.  (the record is missing in table2)
    Note: ABAP gives an error and wants me to use the Having Clause, which is ok, but then ABAP wants me to use Group By, which ok, but then I still get the same syntex error.
    Any thoughts on doing this with the outer join and is null options.  I do not want to select into two internal tables and compare them.

    All,
    I am not trying to do a subquery.  Just a simple outer join where I know some records are missing in the second table.
    Here is the code:
    select eban~banfn
    into table i_delay_banfn
    from eban
    left outer join zsmt_prdelay_upd
    on eban~banfn = zsmt_prdelay_upd~banfn
    where zsmt_prdelay_upd~banfn IS NULL.
    Here is the error message:
    No fields from the right-hand table of a LEFT OUTER JOIN may appear in
    the WHERE condition: "ZSMT_PRDELAY_UPD~BANFN".
    select eban~banfn
    into table i_delay_banfn
    from eban
    left outer join zsmt_prdelay_upd
    on eban~banfn = zsmt_prdelay_upd~banfn
    having zsmt_prdelay_upd~banfn IS NULL.
    Please use code tags
    Edited by: Rob Burbank on Mar 5, 2009 12:20 PM

  • How to create a condition with out join

    Hi all,
    I m using Oracle Discovere Desktop. I want to know that how can i use outer join in conditions.
    e.u.
    category(+) = 'E'
    Regards

    Hi,
    Actually i want to use both equi join and outer join in my one worksheet I have discussed with Micheal and he told me that this is not possible. Because whenever you create more then one condition between two same folders then you have to choose only one condition prompted by Desktop during creation of worksheet.
    Anyway thanks for reply.
    Best Regards,
    Hassan

  • Issues with limit/filter on outer join table in BQY

    I'm converting a series of BQY's from Brio 6.6 to Hyperion 9.3. I have some questions about the "use ODBC outer join syntax on limits" option in the OCE. I sort of understand this option's purpose, but I don't completely understand the SQL I'm seeing. For example Brio 6.6 is generating the following SQL statement:
    SELECT * FROM tblA AL1 LEFT OUTER JOIN tblB AL38 ON (AL38.ParentID=AL1.ChildID AND
    AL38.Data='SomeData') WHERE ((NOT AL38.Action IS NULL))
    Now, Hyperion 9.3 generated the SQL statement as follows:
    SELECT * FROM tblA AL1 LEFT OUTER JOIN tblB AL38 ON (AL38.ParentID=AL1.ChildID AND
    AL38.Data='SomeData') AND (NOT AL38.Response IS NULL))
    My questions are:
    1) Why isn't the "NOT AL38.Action IS NULL" statement included in the outer join in Brio? My limited understanding of the "use ODBC outer join syntax on limits" seems to indicate that it should end up there. I want the SQL to look like this, but I don't know why Brio generates this SQL.
    2) How can I get Hyperion to generate the same SQL as Brio? And still use the OCE with "use ODBC outer join syntax on limits" selected?

    Setting the Cardinality of Department > Employee role to OptionalOne
    gives rise to cartesian join (which is a bigger issue).
    Therefore, the Cardinality of Department > Employee role should remain as
    OptionalMany (default).
    This means, the outer join problem still remains unsolved. I have, therefore,
    unmarked the above answer by me.
    The question is - why has Report Builder been designed in such a way that the primary entity is always the child entity when attributes are selected from both parent and child entities?
    Most people desire that all the rows of the parent entity be fetched irrespective of whether there are corresponding rows in the child entity or not. Report Builder tool should not dictate what the user wants to get, meaning it is not right to assume
    that the focus of the report is Employee when attributes are selected from both Department and Employee. Report Builder should not make the child entity (i.e., Employee) as the primary entity when the user selects attributes from the child entity after
    having selected attributes from the parent entity.
    I am sorry to say that clients may not accept the Report Builder tool as this does not fetch the records as desired.
    I hope there is someone who can suggest how the outer join problem can be solved by just tweaking the properties of the report model (SMDL).
    Besides, the end users are business users and are not tech savvy. They are not expected to modify queries. They would simply drag and drop attributes from entities to create adhoc reports.

  • Oute Joined table with VPD

    I'm having trouble with getting my select to work correctly on a table that is outer_joined AND has a VPD policy associaed with it. Employees are set with specific departments or departments are left blank. I want the employees to see only their department records but also see the ones that are blank. I know I can use a UNION, but I want this to be in a select.
    What I am seeing is the user is getting returned all_rows (even ones that are not their department), but it's blanking out the Dept_desc value for the ones they dont have security for.
    Emp_name____________Dept_Desc
    Bob_________________Sales
    Mike_________________Sales
    Tom_________________________ *Tom's Dept_Desc is 'HR' SHOULD NOT show up in select
    Joe__________________________ * Joe's Dept_Desc is blank so this SHOULD show up in select
    My current select is:
    select Emp_name, Dept_desc
    from DEPT B, EMP A
    where B.DEPT_NO(+) = A.DEPT_NO
    My tables are like this:
    EMP
    Emp_ID
    Emp_name
    DEPT
    Dept_ID
    Dept_Name
    The VPD on my DEPT table would be set like this:
    Dept_Name = 'Sales'

    You predicate function on VPD needs to be modified. Something like
    FUNCTION the_predicate(p_schema VARCHAR2,p_name VARCHAR2)
                RETURN VARCHAR2 IS
    v_context_val VARCHAR2(100):=SYS_CONTEXT(c_context,c_attribute);
    v_restriction VARCHAR2(4000);
    BEGIN
    v_restriction:='(deptno IS NULL OR deptno='||v_context_val;
    RETURN v_restriction;
    END  the_predicate;PS: Not tested.

  • Outer Joins with multiple conditions - alternatives to UNION?

    It is my understanding that Oracle 8i does not directly support mutiple conditions for outer joins. For instance, I'm looking for PEOPLE who may, or may not, be on MEDICATIONS.
    All MEDICATIONS are listed with DRUGNAME and DRUGID. There thousand of different drugs. I'm only looking for PEOPLE on either one or two of them (to make it simple) or no drug at all (ignoring all other DRUGS they're on..) IF they are on the DRUG, it's gerts printed.
    I'd ideally do a LEFT OUTER JOIN to do this with multiple conditions:
    SELECT DISTINCT
    PERSON.NAME,
    MEDICATION.DRUGNAME,
    MEDICATION.DRUGID
    FROM
    PERSON,
    MEDICATION
    WHERE
    PERSON.ID = MEDICATION.ID (+) AND
    (MEDICATION.DRUGID (+) = 632 OR
    MEDICATION.DRUGID (+) = 956)
    This, of course, is not valid, at least in 8i...
    So I've taken the UNION approach:
    SELECT DISTINCT
    PERSON.NAME,
    MEDICATION.DRUGNAME,
    MEDICATION.DRUGID
    FROM
    PERSON,
    MEDICATION
    WHERE
    PERSON.ID = MEDICATION.ID (+) AND
    MEDICATION.DRUGID (+) = 632
    UNION
    SELECT DISTINCT
    PERSON.NAME,
    MEDICATION.DRUGNAME,
    MEDICATION.DRUGID
    FROM
    PERSON,
    MEDICATION
    WHERE
    PERSON.ID = MEDICATION.ID (+) AND
    MEDICATION.DRUGID (+) = 956
    This of course, does work, but as I've added more drugs this becomes quite unwieldly and not really sure what this does to performance. (There are also several more joins to other tables, not relevent here.)
    In addition, if I import this into Crystal Reports 8.5 (as opposed to the Crystal Query Designer), it refuses to recognize the UNION.
    -- Any suggestions for alternative syntax ???
    -- Has this been addressed in 9i ???
    Thanks,
    Will

    You could try
    select Distinct Person.Name, Med.DrugName, Med.DrugId
    from Person,
    (select ID, DrugName, DrugId from Medication
    where DrugId in (632, 956) ) Med
    where Person.ID = Med.ID(+)
    SELECT DISTINCT
    PERSON.NAME,
    MEDICATION.DRUGNAME,
    MEDICATION.DRUGID
    FROM
    PERSON,
    MEDICATION
    WHERE
    PERSON.ID = MEDICATION.ID (+) AND
    (MEDICATION.DRUGID (+) = 632 OR
    MEDICATION.DRUGID (+) = 956)
    This, of course, is not valid, at least in 8i...
    So I've taken the UNION approach:
    SELECT DISTINCT
    PERSON.NAME,
    MEDICATION.DRUGNAME,
    MEDICATION.DRUGID
    FROM
    PERSON,
    MEDICATION
    WHERE
    PERSON.ID = MEDICATION.ID (+) AND
    MEDICATION.DRUGID (+) = 632
    UNION
    SELECT DISTINCT
    PERSON.NAME,
    MEDICATION.DRUGNAME,
    MEDICATION.DRUGID
    FROM
    PERSON,
    MEDICATION
    WHERE
    PERSON.ID = MEDICATION.ID (+) AND
    MEDICATION.DRUGID (+) = 956
    This of course, does work, but as I've added more drugs this becomes quite unwieldly and not really sure what this does to performance. (There are also several more joins to other tables, not relevent here.)
    In addition, if I import this into Crystal Reports 8.5 (as opposed to the Crystal Query Designer), it refuses to recognize the UNION.
    -- Any suggestions for alternative syntax ???
    -- Has this been addressed in 9i ???
    Thanks,
    Will

  • Left outer join Bug? Oracle 11 g.

    Hi , I am facing a strange problem in oracle 11 g .
    I have a select query like this
    Query 1 :
    Select A.name, B.name, C.name from A Left outer join B on A.id = B.id left outer join C on b.id = c.id and (Some complex condition) left outer join D on C.id = D.id;
    A, B, C, D are tables.
    (Assume that I have data which satisfies the above join conditions)
    However I am not getting C.name in the result. Getting NULL in C.name.
    Now if I add a where clause to the above query like the following Query 2 then I get C.name in the results
    Consider that there is a field called field1 in table C and the value of field1 is ‘xyz’ for all the rows of table C .
    Query 2 :
    Select A.name, B.name, C.name from A Left outer join B on A.id = B.id left outer join C on b.id = c.id and (Some complex condition) left outer join D on C.id = D.id where c.field1 = ‘xyz’;
    I find this strange , What role where clause is playing ? Why I get C.name only after adding where clause.
    I also tried following setting with Query 1 however this also did not help me.
    alter session set "_optimizer_join_elimination_enabled"=false;
    Is oracle does some optimization if no where clause is specified ? Is this a bug?
    Please help me out.
    Thanks,
    Sumit

    874384 wrote:
    ...Is this a bug? Maybe. Maybe not. Really difficult to say based on your description. However, if you suspect a bug, then raise a ticket to the support including much more information (e.g. version 11.x.x.x, define "some condition" and so on).
    Nicolas.

  • Outer Join problems - "ORA-30563 outer join operator (+) not allowed in select-list"

    Products: Discoverer 4.1.33.0.2
    (Admin and User/Plus)
    8i EE 8.1.7 (Discoverer server)
    8i EE 8.1.5 ('source data' server)
    Background assumptions: (1) If a column from an "outer-joined" table is compared to a constant, the outer join operator must be applied to that column in order for the outer join to work. (2) A 'Condition' specified in Discoverer User/Plus manifests as a comparison to a constant.
    I created a join in Admin between two folders, selected 'outer join on detail' option. In User/Plus, created worksheet containing columns from the joined folders. When no Conditions are NOT specified, results seem ok. However, when Condition IS added, worksheet encounters "ORA-30563 outer join operator (+) not allowed in select-list" and returns blank sheet.
    To workaround, created Custom folder with outer join in place. Didn't work either with Conditions specified. No error, but I think that because Discoverer did not 'outer join' the Condition column, the outer join was ignored.
    Any insights, ideas, or workarounds are much appreciated.
    -Jim

    If you build a query that uses an outer join then any items from the potentially deficient side of the join will have (+) appended to them everywhere in the sql. Up until 8.1.7 this was OK in the select list as it was just treated as noise and ignored - However this now fails with ORA-30563:
    outer join operator (+) not allowed in select-list...
    In 4.1.33.1.6 you get the error 'ORA-30563 outer join operator(+) not allowed in select list'.
    In 4.1.36.1.10 the query runs OK.. Your work around I would guess would be to create a custom folder as you suggested.

  • LEFT OUTER JOIN SQL syntax

    Haven't seen a solution to this on the forum or in the docs. My last post timed out with no responses, but I still don't know if I have a possible solution.
    I've got 2 objects, Task and Role, that are linked in a M-M relationship.
    My tables are:
    T_TASKS
    T_TASKSROLES
    T_ROLES
    I am querying T_TASKS and joining on T_TASKSROLES and T_ROLES, but I need to use an outer join because not all Tasks have a Role in T_TASKSROLES.
    In SQL Server, my FROM clause SHOULD look like this:
    FROM (T_TASKSROLES t2 LEFT OUTER JOIN T_TASKS t1 ON t1.ID = t2.TASKID) LEFT OUTER JOIN T_ROLES t0 ON t0.ID = t2.ROLEID
    however, if I use eb.anyOfAllowingNone(_roles) in my ExpressionBuilder. TopLink creates a LEFT OUTER JOIN clause that looks like this:
    FROM T_ROLES t0 LEFT OUTER JOIN T_TASKS t1 ON((t0.ID = T_TASKSROLES.ROLEID) AND (t1.ID = T_TASKSROLES.TASKID))
    I can see the logic in how it builds this clause. But, it doesn't parse in SQL Server.
    Is there a way to effect how TopLink generates the FROM clause for outer joins? I mean, I understand how to use the XXXPlatform.java source files and can change whether to use OuterJoin in the WHERE clause or not. But, I can't see anything in the platform class that would allow me to figure this out.
    I realize I could write SQL manually, but is there a way to do this so that the same code would work on SQL Server, Oracle, and Sybase (assuming the DatabaseLogin is configured appropriately)?
    It just seems like LEFT OUTER JOIN when joining M-M relationships isn't generating proper SQL. Is the TopLink SQL SQL92-compliant?
    I should add that I have tried to change SQLServerPlatform to have shouldPrintOuterJoinInWhereClause() return "true". This embeds a "=*" in the join conditions in the WHERE clause.
    SQL Server 2000 still supports this syntax, but the "=*" isn't ALWAYS the correct operator. It is important to put the "*" on the correct side of the expression. TopLink always prints "=*", but the operators are not always in the correct order. So, it tries to create a "left join" on the wrong table.
    So my other question, is it possible to force TopLink to remember to put the outer join table in the RIGHT SIDE?
    Nate

    The workaround is actually more complicated than that, and it can't be fixed by changing only the operator.
    In the queries you listed, the only difference is which side of the "AND" the expressions appear on.
    Change "(t2.rightid (+)= t1.rightid)" to "(t1.rightid (+)= t2.rightid)" and I'm guessing (although not sure because I am testing with SQL Server at the moment), that you'll get a similar query error as I did.
    The bug here is that the default M-M selection criteria creates "reltable = table1 AND table2 = reltable". There is no operator that can satisfy this expression.
    So, the fix that I made, for all of my M-M Mappings was to set the SelectionCriteria manually using the following Expression (returned from this method):
    // This puts M-M relationship tables on the same side of expressions so that OUTER JOINS can be supported.
    private Expression getSameSideExpression() {
              // target side
              Expression selectionCriteria = null;
    Enumeration e2 = getTargetKeyFields().elements();
    Enumeration e = getTargetRelationKeyFields().elements();
    ExpressionBuilder eb = new ExpressionBuilder();
    Expression relTableExp = null;
    while(e2.hasMoreElements()) {
    DatabaseField df = (DatabaseField) e.nextElement();
    DatabaseField df2 = (DatabaseField) e2.nextElement();
    if(relTableExp == null){
    relTableExp = eb.getTable(df.getTable());
    Expression targetFieldExp = eb.getField(df2);
    Expression relFieldExp = relTableExp.getField(df);
    Expression joinExp = relFieldExp.equal(targetFieldExp);
    if(selectionCriteria == null)
    selectionCriteria = joinExp;
    else
    selectionCriteria = joinExp.and(selectionCriteria);
              // source side
    e = getSourceRelationKeyFields().elements();
              e2 = getSourceKeyFields().elements();
    while(e.hasMoreElements()) {
    DatabaseField df = (DatabaseField) e.nextElement();
    DatabaseField df2 = (DatabaseField) e2.nextElement();
    Expression relFieldExp = relTableExp.getField(df);
    Expression sourceFieldExp = eb.getParameter(df2);
    Expression joinExp = relFieldExp.equal(sourceFieldExp);
    if(selectionCriteria == null)
                        selectionCriteria = joinExp;
    else
    selectionCriteria = joinExp.and(selectionCriteria);
              return selectionCriteria;
    This changes the M-M Selection Criteria to "table1 = reltable AND table2 = reltable". Now that this is consistent, using the WHERE clause for my joins in SQL Server is possible.
    If you can think of any other problems this change may have, please let me know.
    Thanks for the help.
    Nate

  • SQL Server "LEFT OUTER JOIN" syntax

    Haven't seen a solution to this on the forum or in the docs.
    I've got 2 objects, Task and Role, that are linked in a M-M relationship.
    My tables are:
    T_TASKS
    T_TASKSROLES
    T_ROLES
    I am querying T_TASKS and joining on T_ROLES, but I need to use an outer join on T_ROLES.
    In SQL Server, my FROM clause SHOULD look like this:
    FROM (T_TASKSROLES t2 LEFT OUTER JOIN T_TASKS t1 ON t1.ID = t2.TASKID) LEFT OUTER JOIN T_ROLES t0 ON t0.ID = t2.ROLEID
    however, if I use eb.anyOfAllowingNone(_roles) in my ExpressionBuilder. TopLink creates a LEFT OUTER JOIN clause that looks like this:
    FROM T_ROLES t0 LEFT OUTER JOIN T_TASKS t1 ON ((t0.ID = T_TASKSROLES.ROLEID) AND (t1.ID = T_TASKSROLES.TASKID))
    I can see the logic in how it builds this clause. But, it doesn't parse in SQL Server.
    Is there a way to effect how TopLink generates the FROM clause for outer joins? I mean, I understand how to use the XXXPlatform.java source files and can change whether to use OuterJoin in the WHERE clause or not. But, I can't see anything in the platform class that would allow me to figure this out.
    I realize I could write SQL manually, but is there a way to do this so that the same code would work on SQL Server, Oracle, and Sybase (assuming the DatabaseLogin is configured appropriately)?
    It just seems like LEFT OUTER JOIN when joining M-M relationships isn't generating proper SQL. Is the TopLink SQL SQL92-compliant?
    Nate

    I should add that I have tried to change SQLServerPlatform to have shouldPrintOuterJoinInWhereClause() return "true". This embeds a "=*" in the join conditions in the WHERE clause.
    SQL Server 2000 still supports this syntax, but the "=*" isn't ALWAYS the correct operator. It is IMPORTANT to put the "*" on the correct side of the expression.
    TopLink always prints "=*", and it always puts it in the correct space, but the OPERATORS are not always in the correct order so you are creating a "left join" on the wrong table.
    So my other question, is it possible to FORCE TopLink to remember to put the outer join table in the RIGHT SIDE?
    Nate

  • SQL 92 Outer Join Syntax and Funtion.

    When i am trying to use {fn substring(..)} or {oj table} in sql query to make it database independent, oralce driver does not support this.
    Could any one explain the above issue?
    If so, How do i use it? Explain the syntax a bit.
    Thanks in Advance,
    Ramani.

    I should add that I have tried to change SQLServerPlatform to have shouldPrintOuterJoinInWhereClause() return "true". This embeds a "=*" in the join conditions in the WHERE clause.
    SQL Server 2000 still supports this syntax, but the "=*" isn't ALWAYS the correct operator. It is IMPORTANT to put the "*" on the correct side of the expression.
    TopLink always prints "=*", and it always puts it in the correct space, but the OPERATORS are not always in the correct order so you are creating a "left join" on the wrong table.
    So my other question, is it possible to FORCE TopLink to remember to put the outer join table in the RIGHT SIDE?
    Nate

  • SQL for View Definition using outer join

    Hello everyone,
    I am creating a view using the statement below
    SELECT *
    FROM table_a A
    ,table_b B
    ,table_c C
    WHERE A.sg_code = B.sg_code and
    B.st_code = 'E' and
    A.sg_code = C.sg_code(+) and
    C.st_code = 'T'
    The structure of the view is as follows
    View
    sg_code| Name | start_date | end_date |
    1 | Test |13-03-2008 | NULL |
    Table_a
    sg_code,Name
    Table_b
    sg_code,st_code,actual_date
    the view can have a null for the column 'end_date'
    This means there will not be a record inserted in the Table_b for end_date=null, there will only be a record for actual_date=start_date
    In this scenario when I query the view I am not seeing the newly created record just because there is a condition "C.st_code = 'T'" with the outer join on the sg_code.
    When I look into the individual tables I see the records.
    Table A
    Pg_code,Name
    1 Test
    Table B
    Id pg_code As_of_date
    1 1 13-03-2008
    How should I modify my view definition so that I can query the view even if there is a null for 'end_date'
    Thanks
    fm

    the last line should be:
    C.st_code(+) = 'T'
    by failing to include the (+) on that line, you made it NOT an outer join. an outer joined table must be outer joined on every where criteria, including to constants.

  • OUTER JOIN 의 GUIDE LINE

    제품 : ORACLE SERVER
    작성날짜 : 2002-04-10
    OUTER JOIN 에 대하여
    ====================
    Purpose
    Outer join의 효과과 이용방법에 대해 이해한다.
    Explanation
    1. 개념
    다음의 용어에 대해 우선 살펴보자 :
    1) outer-join column - symbol(+) 을 사용하는 column 이다 .
    예를 들어 EMPNO(+) ,DEPT.DEPTNO(+) 는 outer join column들이다.
    2) simple predicate - AND , OR,NOT 을 가지지 않는 단순한 관계표현으로
    A=B 의 관계로 표현된다.
    3) outer join predicate - 한개 이상의 outer join column 을 갖는 simple
    predicate 이다.
    2. OUTER JOIN 사용법 - RULES
    outer join predicate 는 오직 1 table 의 column 들 만이 outer join
    column 으로 이용되어져야 한다. 즉 한 single outer join predicate 의
    모든 outer join column 은 모두 같은 table이어야 한다.
    이런 취지에서 다음 statement 는 틀린 것이다.
    EMP.EMPNO(+) = DEPT.DEPTNO(+)
    이것은 두 table 의 outer join column 들이다.
    한 predicate 의 한 column 이 outer join column 이면 같은 table 의 모든
    column 은 outer join column 이어야 한다.
    이 취지에서 다음 문장은 틀린 것이다.
    EMP.SAL + EMP.COMM(+) = SALGRADE.HIGH
    한 table 의 column 들이 outer join 것과 아닌 것과 outer join 인것으로
    섞여있기 때문이다.
    predicate 에서 (+) 표시가 붙은 table 은 다른 table 을 direct 하게
    outer join 한다. indirect 하게 다른 tabe 을 outer join 한다는 것은
    그들 table 자체가 또 outer join 하는 경우이다.
    이 경우 한 table 은 direct하게든 indeirect 하게든 자기 자신에게 outer
    join 하는 경우는 허용되지 않는다.
    다음의 문장은 이런 취지에서 틀린 경우이다.
    EMP.EMPNO(+) = PERS.EMPNO
    AND PERS.DEPTNO(+) = DEPT.DEPTNO
    AND DEPT.JOB(+) = EMP.JOB - circular outer
    join relationship
    3. OUTER JOIN 실행
    주어진 table T 에는 outer join 과 non-outer join 이 있다.
    실행시 다음처럼 수행된다.
    1) The result of joining all tables mentioned in table T's
    outer join predicates is formed ( by recursive application
    of this algorithm ).
    2) For each row of the result, a set of composite rows is
    formed, each consisting of the original row in the
    result joined to a row in table T for which the composite
    row satisfies all of table T's outer join predicates.
    3) If a set of composite rows is the null set, a composite
    row is created consisting of the original row in the
    result joined to a row similar to those in table T, but
    with all values set to null.
    4) Rows that do not pass the non-outer join predicates are removed.
    This may be summarised as follows. Outer join
    predicates ( those with (+) after a column of table T ), are
    evaluated BEFORE table T is augmented with a null row. The null
    row is added only if there are NO rows in table T that satisfy
    the outer join predicates. Non-outer join predicates are
    evaluated AFTER table T is augmented with a null row (if needed)
    4. OUTER JOIN - RECOMMENDATIONS
    Certain types of outer joins in complicated logical
    expressions may not be well formed. In general, outer join
    columns in predicates that are branches of an OR should be
    avoided. Inconsistancies between the branches of the OR can
    result in an ambiguous query, and this may not be detected. It
    is best to confine outer join columns to the top level of the
    'where' clause, or to nested AND's only.
    5. OUTER JOIN - ILLUSTRATIVE EXAMPLES
    1) Simple Outer Join
    SELECT ENAME, LOC
    FROM DEPT, EMP
    WHERE DEPT.DEPTNO = EMP.DEPTNO(+)
    The predicate is evaluated BEFORE null augmentation. If
    there is a DEPT row for which there are no EMP rows, then a null
    EMP row is concatenated to the DEPT row.
    2) Outer Join With Simple Post-Join Predicates
    SELECT ENAME, LOC
    FROM DEPT, EMP
    WHERE DEPT.DEPTNO = EMP.DEPTNO(+)
    AND EMP.DEPTNO IS NULL
    The second simple predicate is avaluated AFTER null
    augmentation, since there is no (+), removing rows which were
    not the result of null augmentation and hence leaving only DEPT
    rows for which there was no corresponding EMP row.
    3) Outer Join With Additional Pre-Join Predicates
    SELECT ENAME, LOC
    FROM DEPT, EMP
    WHERE DEPT.DEPTNO = EMP.DEPTNO(+)
    AND 'CLERK' = EMP.JOB(+)
    AND EMP.DEPTNO IS NULL
    The predicate on EMP.JOB is evaluated at the same time
    as the one on EMP.DEPTNO - before null augmentation. As a
    result, a null row is augmented to any DEPT row for which there
    are no corresponding clerks's in the EMP table. Therefore, this
    query displays departments containing no clerks.
    Note that it the (+) were omitted from the EMP.JOB
    predicate, no rows would be returned. In this case, both the
    EMP.JOB and EMP.DEPTNO IS NULL predicates are evaluated AFETR
    the outer join, and there can be no rows for which both are
    true.

    I had to put it in a subquery? (if that's what it's called)
    SELECT a1.date_field DateAndHour, b1.OR_date, NVL(b1.record_count,0)
    FROM  MASTER_DATE_TABLE a1,
                  (SELECT TO_CHAR(b.OR_IN_DTTM,'YYYYMMDDHH24') OR_date, COUNT(*) record_count
                FROM hsa_tgt.PICIS_OR b
                GROUP BY TO_CHAR(b.OR_IN_DTTM,'YYYYMMDDHH24')) b1
    WHERE a1.date_field  = b1.OR_date (+)
    GROUP BY a1.date_field, b1.OR_date, b1.record_count
    HAVING (TO_DATE(a1.date_field,'YYYYMMDDHH24') BETWEEN '01-Jan-2006' AND '31-Jan-2006')
    ORDER BY a1.date_field;

  • Error with Outer Join

    So, I have a complex VO that includes two updatable entities. One of these is an outer join. It's an adjustment table which has a 0-1 relation with travel Request table that has an estimated amount.
    I only want a record in this adjustement table when there's a change.
    HOWEVER, if I make a change on the screen to the fields in my other entity, ADF wants to insert into the outer join table and I get an error because the field is null and it's required.
    So, how do I keep ADF from inserting a row into the outer join but still update the other entity?
    I'm using JDev 11.1.1.3.0
    Thanks,
    Jet

    Thanks for the feedback. I had to remember to go back and add it to the App Module and juggle the bindings a bit, but I got it sorted out so it doesn't error
    However when I do that and
    if there is no row
    cuz there hasn't been an adjustment yet
    it doesn't give me a field to enter one in. It just prints the label with nothing next to it??????????????????
    if I already put a row in then it displays properly and I can change it.
    How do I make it give me a field so I can insert a row when required?

Maybe you are looking for