We have the same application written in 5.2 & 7.4 on the same SQL DB.
There is a column defined as numeric (12,0). When retrieving the data (has value greater than max of integer, for example, 5000000370) from two applications on 5.2 & 7.4, 5.3 application works w/o any error. But 7.3 application throws "Numeric value out of range" exception.
I understand the reason why it throws the exception since the value (5000000370) is greater than max of integer. The workaround is to define as varchar.
What I do not understand is that why it was working fine in 5.2 application.
I am using fetch_nd() in 7.4 application and sql_FetchNext(Stmt) in 5.2 application
I will appreciate your help in advance
-
- Posts: 8
- Joined: 9 Jul 2014 12:53
-
- VIP Member
- Posts: 1466
- Joined: 28 Feb 2000 0:01
-
- Posts: 8
- Joined: 9 Jul 2014 12:53
-
- VIP Member
- Posts: 1466
- Joined: 28 Feb 2000 0:01
In my mind it is the Vip 7.4 program that work and the Vip 5.2 doesn't work, it does not raise an exception for an overflow/out of range problem that does indeed exist, instead it simply returns a wrong value.
My guess is that you simply receive those bits of the number that fits into a 32bit integer. Your number is 0x12A05F372 (i.e. in hex) fitting it to 32bit gives 0x2A05F372 which is 705033074 in decimal.
If you use the same ODBC connection then you also use the same driver, there may be a difference in various parameter settings used by the two programs, but here it seems that the Vip5.2 program ignores an overflow/our of range error somewhere.
My guess is that you simply receive those bits of the number that fits into a 32bit integer. Your number is 0x12A05F372 (i.e. in hex) fitting it to 32bit gives 0x2A05F372 which is 705033074 in decimal.
If you use the same ODBC connection then you also use the same driver, there may be a difference in various parameter settings used by the two programs, but here it seems that the Vip5.2 program ignores an overflow/our of range error somewhere.
Regards Thomas Linder Puls
PDC
PDC