Skip to Main Content

SQL & PL/SQL

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!

Round Function not working

miniSep 27 2011 — edited Sep 27 2011
Hi friends,

I need to get a round of value in one of my page item field "Balance". For that i have executed the below coding, but it is not bringing the exact value.
declare
a number(30);
begin
select  (round(:P7_AMOUNT, 2) + :P7_CURRENT_BALANCE) into a
from n118_b_trans a, n118_bal_trans b
where :P7_ACCOUNT_NO = b.account_no
dbms_output.put_line(a);
end;
If i tested the above code, by entering the value for the following variable as
:P7_AMOUNT = 250.25
:P7_CURRENT_BALANCE = 300
:P7_ACCOUNT_NUMBER=1062
Then 'a' has to return *550.25*, but the answer that is appearing for me is only 550.

I dont know what went wrong.

Even though for the amount and the balance i have too specified the scale to 4(along with the precision)while defining its datatype in the table, then too why it is not working.

Brgds,
Mini
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 25 2011
Added on Sep 27 2011
5 comments
534 views