The reason behind the oddity is probably 
that bitand() is defined (see standard.sql)
to return a binary_integer (it used to return
a number in earlier versions) and pure SQL 
does not recognise that type, so you need
a method for coercing the result to a number.

It is probably slightly cheaper (though the
point is moot) to use:
    to_number(bitand(x,y))
or    cast(bitand(x,y) as number)
rather than invoking division.

More significantly, your post has highlighted 
an error I made a couple of days ago in a
discussion about x$bh and tablescans.

I wrote:
    to_number(bitand(flag, power(2,19))) = 1
this should have been:
    to_number(bitand(flag, power(2,19))) = power(2,19)

(Of course, the answer I was looking for WAS
a 1, I'd just put it in the wrong place ;)

Apologies for any confusion I caused.


Jonathan Lewis
http://www.jlcomp.demon.co.uk

Next Seminar - UK, April 3rd - 5th
http://www.jlcomp.demon.co.uk/seminar.html

Host to The Co-Operative Oracle Users' FAQ
http://www.jlcomp.demon.co.uk/faq/ind_faq.html

Author of:
Practical Oracle 8i: Building Efficient Databases




-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Jonathan Lewis
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

Reply via email to