in reply to Re^2: Using Optimizer Hints
in thread Using Optimizer Hints

When you run it directly in Oracle, is the hint used? That is, with a host variable.

Replies are listed 'Best First'.
Re^4: Using Optimizer Hints
by sen (Hermit) on Jul 24, 2015 at 14:29 UTC
    Yes, when i executed it direclty, the oracle optimizer uses the hint.

      I just want to be clear here. You are using it with a host variable in Oracle? That will match the prepare with a ?. For example:

      VAR Name VARCHAR2 EXPLAIN PLAN FOR SELECT /*+ index(a index1) */ name, age FROM people a + WHERE name LIKE :Name;

      Also, how are you verifying if the hint is being honored?

      Update: Related: Where the advice to use DBI bind parameters can go wrong (long)