Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: How to inhibit that subquery merging behavior

RE: How to inhibit that subquery merging behavior

From: Bobak, Mark <Mark.Bobak_at_il.proquest.com>
Date: Sun, 18 Jul 2004 07:45:49 -0400
Message-ID: <4C9B6FDA0B06FE4DAF5918BBF0AD82CF09EFEACF@bosmail00.bos.il.pqe>


Jonathan,
Did you try putting rownum in the sub-query's select list? select *
from ( select flag, to_number(num) num, rownum

       from subtest
       where flag in('A','C'))

where num > 0;

-----Original Message-----

From:	oracle-l-bounce_at_freelists.org on behalf of Jonathan Gennick
Sent:	Fri 7/16/2004 8:59 PM
To:	Wolfgang Breitling
Cc:	
Subject:	How to inhibit that subquery merging behavior
Wolfgang,

I can reproduce the error:

SQL> SELECT *
  2 FROM ( SELECT flag, TO_NUMBER(num) num

  3         FROM subtest
  4         WHERE flag IN ('A', 'C') )

  5 WHERE num > 0;
ERROR:
ORA-01722: invalid number

However, I can't find a hint that will prevent the merging of the subquery. I've tried Tanel's suggestions:

SQL> SELECT /*+ NO_MERGE(sub) NO_PUSH_PRED(sub) PUSH_SUBQ(sub) */ *   2 FROM ( SELECT flag, TO_NUMBER(num) num

  3         FROM subtest
  4         WHERE flag IN ('A', 'C') ) sub
  5 WHERE num > 0;
ERROR:
ORA-01722: invalid number

I've also tried putting the hints into the subquery:

SQL> SELECT *
  2 FROM ( SELECT /*+ NO_MERGE NO_PUSH_PRED PUSH_SUBQ */

  3            flag, TO_NUMBER(num) num
  4         FROM subtest
  5         WHERE flag IN ('A', 'C') ) sub
  6 WHERE num > 0;
ERROR:
ORA-01722: invalid number

Is there a hint that will prevent the queries from being merged?

Best regards,

Jonathan Gennick --- Brighten the corner where you are http://Gennick.com * 906.387.1698 * mailto:jonathan@gennick.com

Join the Oracle-article list and receive one article on Oracle technologies per month by email. To join, visit http://five.pairlist.net/mailman/listinfo/oracle-article, or send email to Oracle-article-request_at_gennick.com and include the word "subscribe" in either the subject or body.



Please see the official ORACLE-L FAQ: http://www.orafaq.com

To unsubscribe send email to: oracle-l-request_at_freelists.org put 'unsubscribe' in the subject line.
--

Archives are at http://www.freelists.org/archives/oracle-l/ FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html

Please see the official ORACLE-L FAQ: http://www.orafaq.com

To unsubscribe send email to: oracle-l-request_at_freelists.org put 'unsubscribe' in the subject line.
--

Archives are at http://www.freelists.org/archives/oracle-l/ FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
Received on Sun Jul 18 2004 - 06:42:41 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US