Re: data model
Posted in 2006
"Rob" <nospam@blueyonder.co.uk> wrote in message
news:drncdd$6u2$1$8300dec7@news.demon.co.uk...
> How would I use the system tables to generate an excel spreadsheet
> for each database in an informix instance?
> I need the table name, number of rows, Raw size and lock mode
> Thank you in advance.
In Excel, select "Data / Import External Data / New Database Query".
If this is greyed out, install Microsoft Query from the Office CD.
Uncheck "Use the Query Wizard to create/edit queries".
Choose "<New Data Source>" unless you have an existing one.
In "Add Tables", click Options and enable "System Tables".
Add the "systables" table and close "Add Tables".
Make sure "Tables" and "Criteria" are enabled under "View".
Double click "tabname", "nrows", "rowsize" and "locklevel".
Add criteria "tabid > 99" (excludes system tables).
Add criteria "tabtype = 'T'" (excludes views).
Select "Records / Sort" from the menu and add "tabname".
If you press the SQL button, you should now see:
SELECT systables.tabname, systables.nrows,
systables.rowsize, systables.locklevel
FROM informix.systables systables
WHERE (systables.tabid>99) AND (systables.tabtype='T')
ORDER BY systables.tabname
Select "File / Return Data to Microsoft Excel".
Note that, for "nrows" to be accurate, you will need to run the
SQL statement "update statistics" using "dbaccess" beforehand.
--
Regards,
Doug Lawry
www.douglawry.webhop.org