Bonjour,
I am trying a simple math calcul that my tabletop cheap calculator can easily handle but Sybase just can't ....
declare @totalsize float
select @totalsize=(894720*4096/1048576)
Arithmetic overflow occurred ... Sybase errorcode 3606
No matter what type I use (numerci, bigint, int, nameit), nothing is working, my database is simple unable to handle this calcul.
Anyone has an idea what's going on!?
Request clarification before answering.
Like *all* DBMS's, ASE attempts to translate literals into datatypes - e.g. you couldn't even begin the above in Java without specifying types. ASE attempts based on the value - and for most numeric values without a decimal, it treats as an 'int' unless >2B. So in your case you have:
int * int /int
....but the int*int overflows int.
Simple fix
select @totalsize=(894720.0*4096/1048576)
Now, because of the .0, ASE treats the first value as a float - and following standard ANSI rules float * int = float ... /int = float...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.