| | |
Subtracting a negative value
Please support our Oracle advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
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.)
How do I get number3 to be 7, like math is supposed to work (5 - (-2) = 7)? I keep getting 3. Anyone?
Oracle Syntax (Toggle Plain Text)
DECLARE number1 NUMBER; number2 NUMBER; number3 NUMBER; BEGIN number1 := 5; number2 := -2; number3 := number1 - number2; END; /
How do I get number3 to be 7, like math is supposed to work (5 - (-2) = 7)? I keep getting 3. Anyone?
but i am getting 7, how come you are getting 3 ?
oracle Syntax (Toggle Plain Text)
DECLARE number1 NUMBER; number2 NUMBER; number3 NUMBER; BEGIN number1 := 5; number2 := -2; number3 := number1 - number2; dbms_output.put_line(number3); END;
Share your Knowledge.
![]() |
Similar Threads
- Working with doubles, having some troubles (C++)
- Need help getting text to display in a graphics window (Python)
- Java home work help (long post) (Java)
- Small date problem (ASP)
- how do i sort reords from Z-A? (in turbo C) (C++)
- Classes (C++)
- a program about fractions (C++)
Other Threads in the Oracle Forum
- Previous Thread: Oracle SQL Plus Joining
- Next Thread: Deletion of Autonumber
| Thread Tools | Search this Thread |
2009predictions acquisition amazon.com bartz bernanke cia citrix cloudcomputing crm database dell economy enterprise enterprise2.0 enterprisesoftware federalreserve forbes hp ibm intellipedia internet larryellison layoffs linux loughridge mediawiki michaeljackson microsoft neverland nortel notebooks oil operatingsystem oracle palm rimm saas salesforce sap seagate socialcomputing sun sybase technologystocks virtualiron virtualization vmware wiki wikipedia xen yahoo zoho






