My Oracle Support Banner

WLI 8.1 SP3 - DB Control: can we embed Oracle "hint" comments? - CR202659 (Doc ID 775990.1)

Last updated on FEBRUARY 13, 2020

Applies to:

Oracle Workshop for Weblogic - Version 9.1 and later
Information in this document applies to any platform.
Information in this document applies to any platform


Goal

DESCRIPTION:
Customer says there are such things as "hints", which look like comments and can be embedded in SQL passed
to the database. However, cannot make it work in WebLogic Workshop. Here is a sample:

This is a clip from their current .JCX file
    /**
     * @jc:sql statement::
     * SELECT * 
     * FROM <TABLE>
     * WHERE <CONDITIONS>
     * ORDER BY <ORDER_CLAUSE>
     */
    MetaDataTO[] getRepeatedAttributes(...)
        throws SQLException;

What they want it to read is:
    /**
     * @jc:sql statement::
     * SELECT /*+ first_rows */ * 
     * FROM <TABLE> 
     * WHERE <CONDITIONS>
     * ORDER BY <ORDER_CLAUSE>
     */
    MetaDataTO[] getRepeatedAttributes(...)
        throws SQLException;

But that will not pass the compiler since it has a comment block embedded in another comment block. They can
workaround it this way: 

    /**
     * @jc:sql statement::
     * SELECT {sql: stupid_static_string} * 
     * FROM <TABLE>
     * WHERE <CONDITIONS>
     * ORDER BY <ORDER_CLAUSE>
     */
    MetaDataTO[] getRepeatedAttributes(..., String stupid_static_string)
        throws SQLException;

It works, but then they have to put a static string in every place where this method is called. 

CONFIGURATION:
WebLogic PLatfomr 8.1 SP3
Oracle DB

Solution

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Goal
Solution

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.