Rewrite_or_Error Hint
With Oracle Database 10g, query
rewrite is now possible when your SELECT
statement contains analytic functions,
full outer joins, and set operations
such as UNION, MINUS and INTERSECT. In
addition, you can now use a hint, /*+
REWRITE_OR_ERROR */, which will stop the
execution of a SQL statement if query
rewrite cannot occur.
SQL> SELECT /*+ REWRITE_OR_ERROR */
2 s.prod_id,
3 sum(s.quantity_sold)
4 FROM sales s
5 GROUP BY s.prod_id;
FROM sales s
*
ERROR at line 4:
ORA-30393: a query block in the statement did not rewrite