SAP Knowledge Base Article - Public

2017430 - How to add Oracle hint in Crystal Reports?

Symptom

  • How to add Oracle hint?
  • How to edit the SQL Query to add an Oracle hint?
  • When reporting from an Oracle data source in Crystal Reports, how to add an Oracle hint to the SELECT clause?

Environment

  • SAP Crystal Reports 2013
  • SAP Crystal Reports 2016
  • SAP Crystal Reports 2020
           
  • SAP Crystal Reports for Enterprise 4.1
  • SAP Crystal Reports for Enterprise 4.2
  • SAP Crystal Reports for Enterprise 4.3

Reproducing the Issue

  1. In Crystal Reports, create a report off an Oracle data source.
  2. Add at least one table to the report.
  3. How to modify the SQL Query to add an Oracle hint to the SELECT clause?

Cause

  • In Crystal Reports, when reporting directly from database tables, it generates the SQL Query automatically based on the objects used on the report. It is unfortunately not possible to modify the SQL Query to add Oracle hint to the Select clause.
       
  • Also, there is no option in Crystal Reports to add the use of Oracle hint.

Resolution

  • The suggestions to be able to use Oracle hint, are:
         
    • Create a Stored Procedure in Oracle that uses Oracle hint, and then report off the Oracle Stored Procedure in Crystal Reports; or
           
    • Create a report off an Oracle data source using a Command Object, and in the Command Object, enter the SQL Query manually with the desired Oracle hint in the SELECT clause, like:

            SELECT /*+ FIRST_ROWS(10) */ * FROM Customer 
          
    • Note:
      It is possible to add a Command Object in all versions of Crystal Reports, but not in Crystal Reports for Enterprise 4.0.
      The feature to add Command Object was added to Crystal Reports for Enterprise 4.1.

Keywords

CR, CRFE, CR4E, CR for Enterprise, Oracle Hints, hint, performance , KBA , BI-RA-CR , Crystal Reports designer or Business View Manager , BI-RA-CRE , Crystal Reports for Enterprise , How To

Product

SAP Crystal Reports 2013 ; SAP Crystal Reports 2016 ; SAP Crystal Reports 2020