Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: % Negation Character
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_at_freelists.org
[mailto:oracle-l-bounce_at_freelists.org] 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
--
http://www.freelists.org/webpage/oracle-l
--
http://www.freelists.org/webpage/oracle-l
Received on Fri Jun 15 2007 - 12:01:51 CDT
![]() |
![]() |