Hi All:
What determines the length of a calculated numeric field in SQL? In the following example I was expecting no decimal places, since the calculated field in the first record was 0. However, lo and behold, the structure is N(10, 4). Where did the SQL get that?
I used this test because in the real environment I was getting either '0' or '*' in all the records and I was trying to figure out a way to 'force' a N(10, 5).
SQL Code
SELECT *, num1/num2 num3 ;
FROM test ;
INTO CURSOR curtest
Table Test structure
Num1 3, 0
Num2 3, 0
CurTest Structure
Num1 3, 0
Num2 3, 0
Num3 10, 4
Data in Test
Num1 Num2
0 4
500 49
500 3
Data in curTest
Num1 Num2 Num3
0 4 0.0000
500 49 1.0020
500 3 166.6667
Thanks,
Yossi