Symptom
Crystal Reports 2008 generates SQL statement
SELECT CUSTOMER.C_CUSTKEY, ORDERS.O_ORDERKEY, ORDERS.O_ORDERSTATUS
FROM tpcsf.tpcsf000067.CUSTOMER CUSTOMER LEFT OUTER JOIN tpcsf.tpcsf000067.ORDERS ORDERS ON CUSTOMER.C_CUSTKEY=ORDERS.O_CUSTKEY
WHERE ORDERS.O_ORDERSTATUS='F'
which incorrectly combines a WHERE clause with a JOIN in the FROM clause
Environment
- SAP Crystal Reports 2008
- SAP Sybase ASE ODBC driver
Reproducing the Issue
- Launch Crystal Reports 2008
- Connect to Sybase ASE via ODBC
- Select two tables for the report
- Join the tables with a LEFT OUTER JOIN
- Add a record selection which filters on the right table in the LEFT OUTER JOIN
- Notice that a WHERE clause is generated
Cause
Crystal Reports 2008 is not recognizing the Sybase ODBC driver
Resolution
CAUTION |
The following resolution involves editing the registry. Using Registry Editor incorrectly can cause serious problems that may require you to reinstall the Windows operating system. Use Registry Editor at your own risk. For Information on How to Edit the Registry Key View the Changing Keys And Values online Help topic in Registry Editor (Regedit.exe).It is strongly advised that you make a backup copy of the registry files before you edit the registry. |
- Launch the Registry Editor via Start | Run > regedit
- Open registry key HKEY_CURRENT_USER\Software\Business Objects\Suite 12.0\Crystal Reports\Database
- Create new key HKEY_CURRENT_USER\Software\Business Objects\Suite 12.0\Crystal Reports\Database\QueryBuilder
- Create new key HKEY_CURRENT_USER\Software\Business Objects\Suite 12.0\Crystal Reports\Database\QueryBuilder\JoinBuilder
- Create new String Value StarEqualJoinBuilder
- Set the value of StarEqualJoinBuilder to ODBC3Sybase
- Restart Crystal Reports 2008
- Notice that the following type of query is now generated which contains both the join and filter in the WHERE clause
SELECT CUSTOMER.C_CUSTKEY, ORDERS.O_ORDERKEY, ORDERS.O_ORDERSTATUS
FROM tpcsf.tpcsf000067.CUSTOMER CUSTOMER, tpcsf.tpcsf000067.ORDERS ORDERS
WHERE (CUSTOMER.C_CUSTKEY*=ORDERS.O_CUSTKEY) AND ORDERS.O_ORDERSTATUS='F'
Keywords
- CR
- Syntax
- Query
- Standard Query Language
- Sybase Adaptive Server Enterprise