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: % Negation Character

Re: % Negation Character

From: Guerrero, Citlali (GE, Corporate, consultant) <citlali.guerrero_at_ge.com>
Date: Mon, 18 Jun 2007 10:07:26 -0500
Message-ID: <46769FAE.2090404@ge.com>




  


Hi Nigel,

    Thanks for the tip, however, as you mention on your email, I'm facing some troubles with the data types,  I mean if  I perform:

          raw_value := utl_raw.cast_from_number('2'); -- This is equal to c103
         
   and then I try to get the complement or negative value with this:

        select select utl_raw.bit_COMPLEMENT('c103') from dual;
   I get the value:

 UTL_RAW.BIT_COMPLEMENT('C103')   
 ---------------------------------
 3efc
         
   And when I try to perform this: SELECT utl_raw.cast_to_number('3efc') FROM dual
I got the result: 

UTL_RAW.CAST_TO_NUMBER('3EFC')   
 ---------------------------------
 -105 

What I'm expecting is: 13 ...


   Do you know or have any clue about this??? I really appreciate the help


Regards Citlali
Nigel Thomas escribió:
Citali
>    I'm migrating from Sybase to Oracle, on Sybase I had a function with
>    update XYZ
>    set flag = flag &~4589
You can use BITAND(arg1, arg2) - see the SQL reference for more information. Shame there's no BITOR to go with it... See also UTL_RAW package and functions BIT_AND, BIT_OR, BIT_XOR and BIT_COMPLEMENT. You just need to be careful with datatypes, I seem to remember.
 
I played with UTL_RAW quite recently, but on a previous site so I don't have it to hand, sorry.
 
HTH
 
Regards Nigel
 
-- http://www.freelists.org/webpage/oracle-l Received on Mon Jun 18 2007 - 10:07:26 CDT

Original text of this message

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