Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Data type INTEGER? NUMBER(..,0) with no decimals?

630622Mar 26 2008 — edited Mar 29 2008
Hello everybody

I have a column in my Data Base that must be the result of divide a number to an integer. For example, if I have A=15 and B=2, I need that the column is A/B = 15/2 = 7 (with no decimals, and truncate to 0 always).

My problem is: the result in the Data base with INTEGER datatype or NUMBER (with precission=0) is not 7 but 8; that's because 15/2 = 7,5, and the DB saves a 8 because of the 0,5 decimal.

What data type should I use to truncate the decimal to 0 always?

Thank you and sorry for my english
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 26 2008
Added on Mar 26 2008
2 comments
619 views