Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2004

    Question Unanswered: Differences in 8i / 9i CASE expressions

    Hi all,

    The following query leads to ORA-00932 inconsistent datatypes on 8i, while it works fine with Oracle 9i.

    SELECT CASE WHEN <something>
    THEN (date1 - date2)
    ELSE (date1 - date2 + 1 / 24) END
    FROM <some_table>

    My initial observations -

    1. The Oracle 8i/9i SQL reference says -

    The datatype of all the THEN, ELSE clauses should be the same, which
    should be the same as the datatype of the first THEN clause.

    2. But i confirmed (through an insert stmt) that date1-date2 is indeed a
    number, even date1 - date2 + 1 / 24 is a number, so they are in sync.

    3. Please note that, adding a to_number to the first THEN clause, makes
    the query work fine with both 8i and 9i.

    Please reply.


  2. #2
    Join Date
    Sep 2002
    Provided Answers: 1
    I get the same. It would seem to be a bug in 8i that got fixed in 9i, wouldn't it?

Posting Permissions

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