View Single Post
Join Date: Apr 2007
Posts: 37
Reputation: bondo is an unknown quantity at this point 
Solved Threads: 0
bondo's Avatar
bondo bondo is offline Offline
Light Poster

Subtracting a negative value

 
0
  #1
Nov 13th, 2008
Does anyone know how Oracle's PL/SQL handles subtraction with a negative number? Really what I need to know is, given the following: (NOTE: this is NOT the code I'm working with. It's just an example to give and idea of what I'm trying to do.)
  1. DECLARE
  2. number1 NUMBER;
  3. number2 NUMBER;
  4. number3 NUMBER;
  5. BEGIN
  6. number1 := 5;
  7. number2 := -2;
  8. number3 := number1 - number2;
  9. END;
  10. /

How do I get number3 to be 7, like math is supposed to work (5 - (-2) = 7)? I keep getting 3. Anyone?
Reply With Quote