Results 1 to 3 of 3

Thread: Lazy evaluation

  1. #1
    Join Date
    Mar 2004
    Location
    Warsaw / Poland
    Posts
    73

    Unanswered: Lazy evaluation

    Hello,

    I have two tables, both have the same data.
    Code:
    SELECT *
      FROM Table1
      WHERE ID = 1 AND BITAND(TO_NUMBER(Value),1) = 1
    is OK, but
    Code:
    SELECT *
      FROM Table1
      WHERE BITAND(TO_NUMBER(Value),1) = 1 AND ID = 1
    fails with ORA-01722: invalid number - because of rows with ID != 1 can contain letters in Value column.
    My problem is that
    Code:
    SELECT *
      FROM Table2
      WHERE ID = 1 AND BITAND(TO_NUMBER(Value),1) = 1
    fails, but
    Code:
    SELECT *
      FROM Table1
      WHERE BITAND(TO_NUMBER(Value),1) = 1 AND ID = 1
    is OK.
    Is there any way to force Oracle to evaluate expressions in desired direction?

    Thanks,
    Grzegorz

    PS I've already read http://asktom.oracle.com/pls/ask/f?p...1299201885045, but it's about 8.x, I hope something changed for 9i...
    Last edited by HrabiaGrzegorz; 06-25-04 at 05:40.

  2. #2
    Join Date
    Mar 2002
    Location
    Reading, UK
    Posts
    1,137
    The hint ORDERED_PREDICATES will probably do what your after.

    Alan

  3. #3
    Join Date
    Mar 2004
    Location
    Warsaw / Poland
    Posts
    73
    Yeah, that one works.

    Thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •