Re: Script needed
Posted in 2001
--- "Maxine E. Sarjeant" <btimes@uis.doleta.gov>
escribi': > I realize I didn't say we're using IDS
7.3, etc.
> but now I've got the information I needed using the
> following:
>
> database uidb;
> select systables.tabname,
> count (syscolumns.colname),
> sum (syscolumns.collength)
> from systables,
> syscolumns
> where syscolumns.tabid > 99
> and syscolumns.tabid = systables.tabid
> group by tabname;>
It will not work properly if there are DECIMAL, MONEY,
VARCHAR, and other types of columns. I. e, if there
is a DECIMAL column there is a routine to calculate
the integer portion length (before the dot) and the
decimal portion length.
DEFINE a FLOAT,
tcol LIKE syscolumns.*,
b,c INTEGER
..
..
..
DECLARE alpha CURSOR FOR SELECT * INTO tcol.*
FOREACH alpha
LET a=tcol.collength*2/512
LET b=a
LET c=(b/2+1)*512-512-tcol.collength
# b is the integer portion (before the dot)
# c is the decimal portion length (after the dot)
.
.
.
END FOREACH
.
.
.
>
> > In article <95c918$22e$1@nnrp1.deja.com>,
> > Maxine E. Sarjeant <btimes@uis.doleta.gov> wrote:
> > Hello all,
> > I need to report on all the tables in our
> production database and
> > break down the information per table to include
> the number of
> > columns and the total record length. I was going
> to use the syscolumns
> > table to generate the column and record length
> information and was
> > wondering if anyone out there already has a
> similar script written.
> > TIA,
> > Maxine E. Sarjeant
> >
> > Sent via Deja.com
> > http://www.deja.com/
> >
>
> --
> ============================================
> work: btimes@uis.doleta.gov, aim: max1nes
> home: msarjeant@yahoo.com, aim: mesarjeant
> homepage: http://www.geocities.com/msarjeant/
>
>
> Sent via Deja.com
> http://www.deja.com/
=====
______________________________________
Luis Carlos D'az Otero
ALCANOS DE COLOMBIA S.A. E.S.P
Carrera 9 # 7-25
Neiva (Huila (Colombia))
_________________________________________________________
Do You Yahoo!?
Obtenga su direcci'n de correo-e gratis @yahoo.com
en http://correo.espanol.yahoo.com