문제

My database table contains one column of varchar2(20,10), but since it is a total amount field I need currency data type. (If I enter 1235.5 it should take it as 1235.50.)

I tried changing to type number(20,2), I am not able to do this with number(20,2) in Oracle 10g.

도움이 되었습니까?

해결책

I guess you need not bother about insert, as long you have a precision of atleast 2. When you are fetching using select query, try using the select query as :

Select to_char(1234.4, 'fm9999999.00') from dual; 
Select to_char(1234.45, 'fm9999999.00') from dual; 
Select to_char(1234,'fm9999999.00') from dual;
Select to_char(1234.4567, 'fm9999999.00') from dual;
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top