473,394 Members | 2,168 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Arithmetic overflow

Hi All
I m trying to use a query that would calculate the table size in MB s
rather than pages

The query is as follows
db2 "select rtrim(t.TABSCHEMA) || '.' || t.tabname ,npages,pagesize,
dec((float(( npages*pagesize )) / float((1024*1024))) ,8,3)
"Table_size_in_MBs" from syscat.tables t,syscat.tablespaces ts where
ts.TBSPACEID=t.TBSPACEID and t.TYPE ='T' and npages not in ( -1, 0)
order by Table_size_in_MBs DESC"

But it gives me a arithmetic overflow error when i run it on a AIX
box ...it seems to run properly on Windows machines...
Can some advice me where am i going wrong????
Rgards
Racerx....

Jun 8 '07 #1
1 3407
On Jun 8, 3:03 pm, Racerx <p.paingan...@gmail.comwrote:
Hi All
I m trying to use a query that would calculate the table size in MB s
rather than pages

The query is as follows

db2 "select rtrim(t.TABSCHEMA) || '.' || t.tabname ,npages,pagesize,
dec((float(( npages*pagesize )) / float((1024*1024))) ,8,3)
"Table_size_in_MBs" from syscat.tables t,syscat.tablespaces ts where
ts.TBSPACEID=t.TBSPACEID and t.TYPE ='T' and npages not in ( -1, 0)
order by Table_size_in_MBs DESC"

But it gives me a arithmetic overflow error when i run it on a AIX
box ...it seems to run properly on Windows machines...

Can some advice me where am i going wrong????

Rgards
Racerx....
Although I don't know the reason, moving position of float function
may be a workaround.
db2 "select rtrim(t.TABSCHEMA) || '.' || t.tabname ,npages,pagesize,
dec((( float(npages)*pagesize ) / (float(1024)*1024)) ,8,3)
"Table_size_in_MBs" from syscat.tables t,syscat.tablespaces ts where
ts.TBSPACEID=t.TBSPACEID and t.TYPE ='T' and npages not in ( -1, 0)
order by Table_size_in_MBs DESC"

Jun 8 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Karthik | last post by:
Hi, I am writing this application that needs a lot of arithmetic calculations. I was wondering if C++ language specifies any way of detecting arithmetic overflows. Let us consider the following...
5
by: Fraser Ross | last post by:
void f(unsigned int const x) { }; int main(int argc, char* argv){ //unsigned short a=0xFFFF; enum { a=0xFFFF }; f(a*0x10000+0xFFFF); return 0; } I get an arithmetic overflow when using a as...
10
by: Massimiliano Alberti | last post by:
Are there rules on how should the C behave with the arithmetic operations? Are the overflows always ignored? And are they simply truncated? (if I have a 16-bits unsigned short ints unsigned short...
16
by: TTroy | last post by:
Hello, I'm relatively new to C and have gone through more than 4 books on it. None mentioned anything about integral promotion, arithmetic conversion, value preserving and unsigned preserving. ...
4
by: glenn | last post by:
I have a COM Server I've written in C#. I have a client app I've written in Delphi that is calling the C# COM Server. However, one of the functions in the COM Server creates a form and during the...
4
by: Tom | last post by:
I have a VB.NET framework 1.1 application that I am installing on my user's workstation. It works fine on EVERY machine except for one - on this one machine it generates a 'Overflow or underflow in...
3
by: Paul Cheetham | last post by:
Hi, I am developing a program that is doinbg time calculations using Ticks. Below is a piece of code that is causing an arithmetic overflow exception - the single line inside the try statement....
9
by: Mike Aubury | last post by:
Is there any standard (or even non-standard) way to detect limit overflow in arithmetic in C ? eg. /* assuming 4 byte ints.. */ int a=2147483647; int b=2147483647; int c;
1
by: thebigsquid | last post by:
hi, its me again, so this software obviously has serious problems. now i'm getting this error message when i try to access any of it! any ideas much appreciated thanks the big squid An...
10
by: Why Tea | last post by:
I understood that the CPU registers determine the size of the machine. But what is the correct way to code an arithmetic operation to avoid wrap-around when the code is to be run on both 32-bit and...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.