Anyone have a function to compute the size of a column?
Posted in 1995
> From: ennis@rastov10.comm.mot.com (Bill Ennis) > Subject: Anyone have a function to compute the size of a column? > > Hi, > > I am working on an application which estimates the size a > table will take. It looks at the data and index space for > a table and therefore needs individual column sizes. This > is easy for columns which are integers, character strings, > etc since you can just query collength from syscolumns. > However, it's not so easy for columns which are datetime > since collength does not store the size dierctly. I have > located the information needed to do this in the SQL guide > but am looking to see if someone has already done this since > it would be a tedious function to write. > > Thanks in advance. > Bill > [...sig deleted...] I wrote a short shell script which is nearly verbatim the extent size calculation from the SQL Tutorial. It will ask for the sizes of the columns, and help you calculate datetime and varchars and such. It yields total extent sizes, max number of extents, and row size. This may not be exactly what you want, but it may prove helpful. BTW, here's a better Bart: |\\/\\/\\/| | | | | | (o)(o) C _) | ,___| | / /____\\ / \\ __________________________________________________________________ | Clem Akins Standard Disclaimers Apply | |Reynolds Metals Co, Alloys Plant "Climb High, Cave Deep!" | | Muscle Shoals, Alabama USA cwakins@leia.alloys.rmc.com | |________________________________________________________________|