Change Outer Join Syntax

Post Author: jasonp1980
CA Forum: Data Connectivity and SQL
I am currently using a ODBC driver provided by Esker to link into an IBM Informix Database 4.2When compiling a link in Crystal the SQL for this comes out as shown bellow with a syntax error. FROM   table1 LEFT OUTER JOIN table2But if I amend this to as bellow it works  FROM   table1, OUTER table2How can I change the term used in Crystal XI (11) for outer joins, I found some documentation on how to do this for version 7 (link bellow) but not for XI, thanks for any help. http://technicalsupport.businessobjects.com/KanisaSupportSite/search.do;jsessionid=0762FD2EDFF69A9AD85E7FB81E7E6573?cmd=displayKC&docType=kc&externalId=c2003023&sliceId=&dialogID=360384&stateId=1%200%20356275  

Post Author: V361
CA Forum: Data Connectivity and SQL
Jason, Save out a copy of the report, and then open it,  if you use a command, you should be able to put your own SQL in.  Database, set datasource, create new connection, select your data source,  select add command.
Your SQL statement will go in the command.

Similar Messages

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

  • Outer Join Syntax in sql2k to Oracle Migration

    All of my existing SQL Server 2000 code is using the (INNER, LEFT OUTER, RIGHT OUTER) JOIN syntax which according to Oracle SQL Reference (A90125-01) is supported. The migration workbench seems to want to convert this to the old style syntax of putting (+) in the where clause conditions. I am therefore getting lots of warnings telling me that "complex outer joins are not reliably supported". Is there a setting somewhere that will tell the migration workbench to maintain (subject to required conversion) the original syntax format.

    Hi Doug,
    The issue you report has been tackled in a recent internal build released by the OMWB team. OMWB version 9.2.0.1.6 which is freely downloadable on the http:\\mtg.ie.oracle.com site. As I've mentioned, this is an internal release and is therefore not supported - although it is very stable and has already been used by several internal customers. We expect to have a fully supported release of OMWB available on OTN in December.
    In version 9.2.0.1.6, there is an option in the "Parse Options" tab on the Stored Procedures property sheet called "Generate Oracle 8i Outer Joins" - this setting is switched off by default in this build and would therefore preserve your ANSI compliant joins by default. Switching the setting on causes the OMWB parser to generate the joins in the old (+) Oracle syntax standard.
    I hope this helps,
    Tom.

  • "use ODBC outer join syntax on limits"  issues

    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? I'm OK with the fact that it is not, but my limited understanding of the "use ODBC outer join syntax on limits" seems to indicate that it should end up there.
    2) The Hyperion SQL is returning incorrect results. 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? This setting is working fine for other BQY's.

    In the first post, I modified the actual table name I'm using, the following is my actual output:
    SQL> SELECT A0.name partName,A2.name usedPartName FROM WTPartUsageLink A1
    2 RIGHT OUTER JOIN (
    3 (SELECT A0.idA2A2,A0B.name FROM WTPart A0 INNER JOIN WTPartMaster A0B
    4 ON ((A0.idA3masterReference = A0B.idA2A2)))
    5 UNION ALL
    6 (SELECT A0.idA2A2,A0B.name
    7 FROM WTProduct A0 INNER JOIN WTProductMaster A0B ON ((A0.idA3masterRefer
    ence = A0B.idA2A2)))) A0
    8 ON (A0.idA2A2 = A1.idA3A5) LEFT OUTER JOIN
    9 (SELECT A2.idA2A2,A2.name FROM WTPartMaster A2
    10 UNION ALL
    11 SELECT A2.idA2A2,A2.name FROM WTProductMaster A2) A2
    12 ON (A1.idA3B5 = A2.idA2A2) ORDER BY partName DESC,usedPartName DESC;
    FROM WTProduct A0 INNER JOIN WTProductMaster A0B ON ((A0.idA3masterRefer
    ence = A0B.idA2A2)))) A0
    ERROR at line 7:
    ORA-00923: FROM keyword not found where expected
    SQL> select * from v$version;
    BANNER
    Oracle9i Enterprise Edition Release 9.2.0.1.0 - 64bit Production
    PL/SQL Release 9.2.0.1.0 - Production
    CORE 9.2.0.1.0 Production
    TNS for Solaris: Version 9.2.0.1.0 - Production
    NLSRTL Version 9.2.0.1.0 - Production
    Thanks,

  • Old outer join syntax produces different results from new syntax!

    I have inherited a query that uses the old outer join syntax but that is yielding correct results. When I translate it to the new outer join syntax, I get the results I expect, but they are not correct! And I don't understand why the old syntax produces the results it produces. Bottom line: I want the results I'm getting from the old syntax, but I need it in the new syntax (I'm putting it into Reporting Services, and RS automatically converts old syntax to new).
    Here's the query with the old outer join syntax that is working correctly:
    Code Snippet
    SELECT   TE = COUNT(DISTINCT T1.ID),
             UE = COUNT(DISTINCT T2.ID),
             PE = CONVERT(MONEY, COUNT(DISTINCT T2.ID)) / 
                  CONVERT(MONEY,COUNT(DISTINCT T1.ID))
    FROM     TABLE T1, TABLE T2
    WHERE    T1 *= T2
    In this query, much to my surprise, TE <> UE and PE <> 1. However, TE, UE, and PE seem to be accurate!
    Here's the query with the new outer join syntax that is working but not producing the results I need:
    Code Snippet
    SELECT   TE = COUNT(DISTINCT T1.ID),
             UE = COUNT(DISTINCT T2.ID),
             PE = CONVERT(MONEY, COUNT(DISTINCT T2.ID)) / 
                  CONVERT(MONEY,COUNT(DISTINCT T1.ID))
    FROM     TABLE T1 LEFT OUTER JOIN TABLE T2 ON T1.ID = T2.ID
    Though not producing the results I need, it is producing what would be expected: TE = UE and PE = 1.
    My questions:
    1) Can someone who is familiar enough with the old syntax please help me understand why TE <> UE and PE <> 1 in the first query?
    2) Can someone please tell me how to properly translate the first query to the new syntax so that it continues to produce the results in the first query?
    Thank you very much.

    How can we reproduce the issue?
    Code Snippet
    USE [master]
    GO
    EXEC sp_dbcmptlevel Northwind, 80
    GO
    USE [Northwind]
    GO
    SELECT
    TE
    = COUNT(DISTINCT T1.OrderID),
    UE = COUNT(DISTINCT T2.OrderID),
    PE = CONVERT(MONEY, COUNT(DISTINCT T2.OrderID)) /
    CONVERT(MONEY,COUNT(DISTINCT T1.OrderID))
    FROM
    dbo
    .Orders T1, dbo.Orders T2
    WHERE
    T1
    .OrderID *= T2.OrderID
    SELECT
    TE
    = COUNT(DISTINCT T1.OrderID),
    UE = COUNT(DISTINCT T2.OrderID),
    PE = CONVERT(MONEY, COUNT(DISTINCT T2.OrderID)) /
    CONVERT(MONEY,COUNT(DISTINCT T1.OrderID))
    FROM
    dbo
    .Orders T1
    LEFT OUTER JOIN
    dbo.Orders T2
    ON T1.OrderID = T2.OrderID
    GO
    EXEC sp_dbcmptlevel Northwind, 90
    GO
    Result:
    TE
    UE
    PE
    830
    830
    1.00
    TE
    UE
    PE
    830
    830
    1.00
    As you can see, I am getting same results.
    AMB

  • 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

  • Oracle 8i Full Outer Join Syntax

    Can someone please help me run this on Oracle 8i:
    SELECT
    R.CUSTOMER_NUM,
    R.SURNAME_NM,
    R.FIRST_NM,
    R.STREET_NM,
    R.PROV_CD,
    R.CITY_NM,
    R.POSTL_CD,
    W.ADDR_TWO_DESC,
    C.RTL_CO_NUM,
    C.CARD_NUM
    FROM
    RTL_CUST R
    FULL OUTER JOIN WHLSL_CUST W ON (R.CUST_NUM = W.CUST_NUM)
    FULL OUTER JOIN CUSTOMER_CARD C ON (T.CUST_NUM = C.CUST_NUM)
    I only know the ANSI syntax. Whats the old one?

    Is this correct:
    SELECT R.CUST_NUM, R.SURNAME_NM, R.FIRST_NM, R.STREET_NM, R.PROV_CD, R.CITY_NM, R.POSTL_CD, W.ADDR_TWO_DESC, NULL AS RTL_CO_NUM, NULL AS CARD_NUM
    FROM CCD_RTL_CUST R, CCD_WHLSL_CUST W WHERE R.CUST_NUM (+) = W.CUST_NUM
    UNION
    SELECT R.CUST_NUM, R.SURNAME_NM, R.FIRST_NM, R.STREET_NM, R.PROV_CD, R.CITY_NM, R.POSTL_CD, W.ADDR_TWO_DESC, NULL AS RTL_CO_NUM, NULL AS CARD_NUM
    FROM CCD_RTL_CUST R, CCD_WHLSL_CUST W WHERE R.CUST_NUM = W.CUST_NUM (+)
    UNION
    SELECT R.CUST_NUM, R.SURNAME_NM, R.FIRST_NM, R.STREET_NM, R.PROV_CD, R.CITY_NM, R.POSTL_CD, NULL AS ADDR_TWO_DESC, C.RTL_CO_NUM, C.CARD_NUM
    FROM CCD_RTL_CUST R, CUST_CARD C WHERE R.CUST_NUM (+) = C.CUST_NUM
    UNION
    SELECT R.CUST_NUM, R.SURNAME_NM, R.FIRST_NM, R.STREET_NM, R.PROV_CD, R.CITY_NM, R.POSTL_CD, NULL AS , C.RTL_CO_NUM, C.CARD_NUM
    FROM CCD_RTL_CUST R, CUST_CARD C WHERE R.CUST_NUM = C.CUST_NUM (+);

  • Outer join syntax - oracle 8i

    Here is an Oracle 8i issue I've run into ....
    I am trying to create a table that contains a record for each hour of the day (even if count is 0). I have a problem when I try a right outer join using the following syntax:
    SELECT MDT.date_field, COUNT(*)
    FROM MASTER_DATE_TABLE MDT, hsa_tgt.PICIS_OR POR
    WHERE MDT.date_field = TO_CHAR(POR.OR_IN_DTTM,'YYYYMMDDHH24') (+)
    AND TO_DATE(MDT.date_field,'YYYYMMDDHH24') >= '01-Jan-2006'
    AND TO_DATE(MDT.date_field,'YYYYMMDDHH24') <= '31-Jan-2006'
    GROUP BY MDT.date_field;
    The problem 'SQL code no properly ended' only occurs if I use the TO_CHAR function (or any function for that matter) on the outer join line.
    Is there a workaround? I did manage to create a temporary table and then successfully do an outer join in order to bypass having the to_char function in the join statement.
    Maybe a union?
    TIA

    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;

  • Outer Join Syntax

    I have an SQL statement with an outer join which works just fine, but when I go and add an "UPPER" function to one of the where statements, I get and error message indicating that my Command is not properly ended (Oracle 8I). Why?
    Select ECD_ID, to_char(DATE_OF_SUBMISSION, 'MM/DD/YYYY') as Date_Of_Submission
    from ECD_Project_State_Log, code_tbl a, code_tbl b, users u
    where ECD_ID = 1
    and UPPER(CURR_PROJECT_STATE) = UPPER(a.code_Name) (+)
    and REQ_PROJECT_STATE = b.code_Name (+)
    and REVIEWED_BY = u.User_id (+)
    order by Date_Of_Submission;

    Try this:
    and UPPER(CURR_PROJECT_STATE) = UPPER(a.code_Name(+))
    SQL> select e.ename, d.loc from emp e, dept d where d.deptno = upper(e.deptno)(+) ;
    select e.ename, d.loc from emp e, dept d where d.deptno = upper(e.deptno)(+)
    ERROR at line 1:
    ORA-00936: missing expression
    SQL> select e.ename, d.loc from emp e, dept d where d.deptno = upper(e.deptno(+)) ;
    ENAME      LOC
    CLARK      NEW YORK
    KING       NEW YORK
    MILLER     NEW YORK
    SMITH      DALLAS
    ADAMS      DALLAS
    FORD       DALLAS
    SCOTT      DALLAS
    JONES      DALLAS
    ALLEN      CHICAGO
    BLAKE      CHICAGO
    MARTIN     CHICAGO
    JAMES      CHICAGO
    TURNER     CHICAGO
    WARD       CHICAGO
               BOSTON
    15 rows selected.
    SQL> disconnect
    Disconnected from Oracle9i Enterprise Edition Release 9.2.0.3.0 - Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.3.0 - Production
    SQL>

  • LEFT OUTER JOIN multiple tables - using the 9i syntax

    I've always written my queries using the (+) operator for outer joins. I want to start using the new ANSI standard available in 9i. I can do it when I'm joining two tables in a simple query, but how does it work when I am joining multiple tables?
    Here is an example of some SQL that works with the (+) outer join syntax. How can I convert this to use the LEFT OUTER JOIN syntax?
    SELECT *
    FROM audit_entry aue,
    audit_table aut,
    audit_statement aus,
    audit_row aur,
    audit_row_pkey aup1,
    audit_row_pkey aup2
    WHERE aue.audit_entry_id = aus.audit_entry_id
    AND aut.table_name = 'TEST_AUDITING'
    AND aut.table_owner = 'CLA_JOURNAL'
    AND aus.audit_table_id = aut.audit_table_id
    AND aur.audit_statement_id (+) = aus.audit_statement_id
    AND aup1.audit_row_id (+) = aur.audit_row_id
    AND aup1.pk_column_name (+) = 'TEST_AUDTING_PK_1'
    AND aup2.audit_row_id (+) = aur.audit_row_id
    AND aup2.pk_column_name (+) = 'TEST_AUDITING_PK_2'
    I can join audit_statement to audit_entry easy enough, but then I want to join audit_table to audit_statement, how do I do that, do I start nesting the join statements?
    Thanks
    Richard

    Thanks for getting back so quickly, I have tried the suggested SQL with mixed results:
    SELECT COUNT(*)
    FROM audit_entry aue
    JOIN audit_statement aus ON aue.audit_entry_id = aus.audit_entry_id
    JOIN audit_table aut ON aus.audit_table_id = aut.audit_table_id
    RIGHT OUTER JOIN audit_row aur ON aur.audit_statement_id = aus.audit_statement_id
    RIGHT OUTER JOIN audit_row_pkey aup1 ON aup1.audit_row_id = aur.audit_row_id
    RIGHT OUTER JOIN audit_row_pkey aup2 ON aup2.audit_row_id = aur.audit_row_id
    WHERE aut.table_name = 'TEST_AUDITING_TWO'
    AND aut.table_owner = 'CLA_JOURNAL'
    AND aup1.pk_column_name = 'TEST_AUDTING_PK_1'
    AND aup2.pk_column_name = 'TEST_AUDITING_PK_2'
    I had to change the order slightly, between the first two JOINs but otherwise it executed OK. My problem is, it should only return 175 rows but its returning 30625 rows. If I comment out the second reference to audit_row_pkey I get the expected result:
    SELECT COUNT(*)
    FROM audit_entry aue
    JOIN audit_statement aus ON aue.audit_entry_id = aus.audit_entry_id
    JOIN audit_table aut ON aus.audit_table_id = aut.audit_table_id
    RIGHT OUTER JOIN audit_row aur ON aur.audit_statement_id = aus.audit_statement_id
    RIGHT OUTER JOIN audit_row_pkey aup1 ON aup1.audit_row_id = aur.audit_row_id
    --RIGHT OUTER JOIN audit_row_pkey aup2 ON aup2.audit_row_id = aur.audit_row_id
    WHERE aut.table_name = 'TEST_AUDITING_TWO'
    AND aut.table_owner = 'CLA_JOURNAL'
    AND aup1.pk_column_name = 'TEST_AUDTING_PK_1'
    --AND aup2.pk_column_name = 'TEST_AUDITING_PK_2'
    It looks the same condition is being used in each case but why do I suddenly get so many rows - its joining differently somehow. It must be to do with the order, do I need to bracket the query?
    Thanks again
    Richard

  • Oj syntax for outer join

    Is there a way to make Crystal Reports XI not generate the {oj .....   syntax for outer joins?
    In Crystal Reports 8, you could do a registry change to keep CR from using oj, but that doesn't seem to work on CR XI (or I don't know where to make the registry change)

A: oj syntax for outer join

Outer Join Escape Sequence builds the syntax for ODBC drivers using the outer join syntax in its SQL syntax.
Use Regedit on the problem client machine add following keys:
STEP 1........For Crystal Reports 9: HKEY_CURRENT_USER\Software\Crystal Decisions\9.0\Crystal Reports\Database\QueryBuilder\OuterJoinEscSeq
<<<OR>>>
...................For Crystal Reports 10:HKEY_CURRENT_USER\Software\Crystal Decisions\10.0\Crystal Reports\Database\QueryBuilder\OuterJoinEscSeq
STEP 2........"MSOuterJoinEscSeq"= "insert your ODBC driver name here": List of the drivers that support Microsoft ODBC {oj ..} join escape sequence.
"NoOuterJoinEscSeq"= "insert your ODBC driver name here": List of the drivers that do not support any join escape sequence.
For example...
MSOuterJoinEscSeq = "UVODBC"

Outer Join Escape Sequence builds the syntax for ODBC drivers using the outer join syntax in its SQL syntax.
Use Regedit on the problem client machine add following keys:
STEP 1........For Crystal Reports 9: HKEY_CURRENT_USER\Software\Crystal Decisions\9.0\Crystal Reports\Database\QueryBuilder\OuterJoinEscSeq
<<<OR>>>
...................For Crystal Reports 10:HKEY_CURRENT_USER\Software\Crystal Decisions\10.0\Crystal Reports\Database\QueryBuilder\OuterJoinEscSeq
STEP 2........"MSOuterJoinEscSeq"= "insert your ODBC driver name here": List of the drivers that support Microsoft ODBC {oj ..} join escape sequence.
"NoOuterJoinEscSeq"= "insert your ODBC driver name here": List of the drivers that do not support any join escape sequence.
For example...
MSOuterJoinEscSeq = "UVODBC"

  • 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

  • Outer join OJ syntax with JDBC drivers

    Hello,
    I'm facing a problem with CrystalReports 2008 and jdbc connection.
    Crystal genrates OJ syntax (as below) which cannot be interpreted by the Database.
    SELECT "T1"."T1D", "T2"."T2D", "T3"."T3D"
    FROM   {oj ("PUBLIC"."PUBLIC"."T3" "T3" LEFT OUTER JOIN "PUBLIC"."PUBLIC"."T2" "T2" ON "T3"."T2K"="T2"."T2K") LEFT OUTER JOIN "PUBLIC"."PUBLIC"."T1" "T1" ON "T2"."T1K"="T1"."T1K"}
    Prensently my database is HSQLDB.
    After browsing several post about ODBC, I tried to change the registry, introducing a new key
    HKEY_CURRENT_USER\Software\Business Objects\Suite 12.0\Crystal Reports\DatabaseOptions\NoOuterJoinEscSeq=myodbc3,hsqldb
    It did not change anything.
    Now, I suppose Crystal queries the database driver for its capabilities.
    This is done by a DatabaseMetaData object which implements several methods.
    In case of hsqldb, here is what the driver answers:
         public boolean supportsMinimumSQLGrammar() throws SQLException {
              return false;
         public boolean supportsCoreSQLGrammar() throws SQLException {
              return true;
         public boolean supportsExtendedSQLGrammar() throws SQLException {
              return false;
         public boolean supportsANSI92EntryLevelSQL() throws SQLException {
              return false;
         public boolean supportsANSI92IntermediateSQL() throws SQLException {
              return false;
         public boolean supportsANSI92FullSQL() throws SQLException {
              return false;
         public boolean supportsIntegrityEnhancementFacility() throws SQLException {
              return true;
         public boolean supportsOuterJoins() throws SQLException {
              return true;
         public boolean supportsFullOuterJoins() throws SQLException {
              return false;
         public boolean supportsLimitedOuterJoins() throws SQLException {
              return true;
    How can I tell Crystal to stop using the OJ syntax ?
    Thank you and kind regards.
    Alain

    Hi Alaine,
    You are correct, CR does query the driver to get what it requires to use for outer join syntax. The registry key will not work for this driver. It's the driver meta layer telling CR to use the oj syntax and is dependent on the driver being configured.
    Not sure if you can but start by trying to alter these settings if you can:
    public boolean supportsOuterJoins() throws SQLException {
    return true;
    public boolean supportsFullOuterJoins() throws SQLException {
    return false;
    I would think both should be reversed, true to false and false to true.
    Before you do that though go to our download page and install Service Pack 2, it may by a CR issue and the patch may have fixed the problem.
    If it doesn't I suggest asking this on the HSQLDB forum to see how to alter those option. CR follows the JDBC Type 4 Standards. You may want to see if Sun has a HSQLDB JDBC driver also.
    Thank you
    Don

  • 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

  • Maybe you are looking for

    • HTTP Call Service in 2013 Workflow

      How can you configure a workflow (Sharepoint 2013)  to call an HTTP Web Service request and evaluate the response headers to determine if the POST to an MVC Controller end-point was a success or failure

    • Wifi does not connect to preferred network

      I have two wireless networks, an Apple network and one provided by my broadband supplier Virgin. The base stations are located in different parts of the house.  My Macbook Pro will persist in connecting to the Apple network even when it is located in

    • Alerts Question

      Hi Generally by default alert is triggered AFTER the max number of retry (say 3 times) as configured in J2EE visual admin. However, is it possible if I would like the alert trigers immediately the 1ST attempt failed while runtime still will continue

    • Exporting a highlighted section of the song

      Is there a way to highlight a certain section of a song then export just that part instead of the entire song?

    • Service Provider info

      I changed internet service providers (comcast to verizon) the end of July. I had changed my email address to a gmail one and made that change in Settings a while ago.  I am now constantly getting this message "Cannot get mail -- the connection to the