RE: % Negation Character

  • From: "Mercadante, Thomas F (LABOR)" <Thomas.Mercadante@xxxxxxxxxxxxxxxxx>
  • To: <citlali.guerrero@xxxxxx>, "oracle-l" <oracle-l@xxxxxxxxxxxxx>
  • Date: Fri, 15 Jun 2007 13:01:51 -0400

Citali,

If what you need to do is to make the value within a column to be the
negative of itself, then the following would do it.  Note that this even
updates negative numbers to itself because the ABS function takes the
absolute value of the column and returns a positive value.
 
update xyz
set flag = abs(flag) * -1

Hope this helps.

Tom

-----Original Message-----
From: oracle-l-bounce@xxxxxxxxxxxxx
[mailto:oracle-l-bounce@xxxxxxxxxxxxx] On Behalf Of Guerrero, Citlali
(GE, Corporate, consultant)
Sent: Friday, June 15, 2007 12:40 PM
To: oracle-l
Subject: % Negation Character

Hi Folks,

    I'm migrating from Sybase to Oracle, on Sybase I had a function with

and update:

    update XYZ
    set flag = flag &~4589
  
   Now on Sybase "~" character is used as negative character, so the 
query do this (on sybase): Update the table XYZ on the Flag column with 
the bitand beteewn flag and 4589 if the binary bit corresponding to this

value is not ON ...

  How can I do this on Oracle?? I mean is there any negation character 
on oracle similiar to ~ on Sybase?? I been searching but I still don't 
find anything helpful, could someone advice about this??

Thanks in advanced.

Cheers, Citlali

--
//www.freelists.org/webpage/oracle-l




--
//www.freelists.org/webpage/oracle-l


Other related posts: