Subject: tc_info.per - Table/Column Info Screen
From: Daniel Martin <drmartin@tyrell.net>
Newsgroups: comp.databases.informix
Date: Mon, 21 Oct 1996 17:55:02 GMT


I have found the Informix Screen File below useful from time to time. It
looks into the System Tables to show all Table and Columns (and their
types). Hope you do, too.  BTW, works OK on SQL 4.1 and SE 5.01.  Newer
Informix versions may [will probably] have different System
Table-Structure.  You will need to modify to suit. 

 - Dan
      +------------------------------------------------------------------+
      |  Striving to be what the liberals call a "tax-cuts-for-the-rich, |
      |  mean-spirited, intolerant, radical, religious-right, extremist" |
      +------------------------------------------------------------------+

{tc_info.per by Dan Martin Thu Apr 11 20:35:55  1991

 NOTES: (A) See also Form cq.per

        (B) These [supposedly] Correct values came from the
            Fall 1990 IFX Tech Notes, Page 52.

       Value Type (Nulls OK)  Value Type (Nulls NOT OK)
       ===== ===============  ===== ===================
          0  char              256   char (& all below ditto)
          1  smallint          257
          2  integer           258
          3  float             259
          4  smallfloat        260
          5  decimal           261
          -            serial  262
          7  date              263
          8  money             264
          9  (not used)        ---
         10  datetime          266
         11  byte              267
         12  text              268
         13  varchar           269
         14  interval          270
}
DATABASE your_db_name_here
SCREEN
{

SPIMS TABLE INFORMATION: (Master)     *tabid < 100 are system tables.
===================================
 tabname [f000              ]
   owner [f001    ]
 dirpath [f002                                                            ]
                                 COLUMN INFORMATION (Detail)
                                 ===============================
*  tabid [f004] *                   colname [f013              ]
 rowsize [f005  ]                     colno [f015  ] ___coltype_values_______
   ncols [f006  ]                   coltype [f016  ] 0=char        5=decimal
nindexes [f007  ]                 collength [f017  ] 1=smallint  262=serial
   nrows [f008       ]                               2=integer     7=date
 created [f009      ]                                3=float       8=money 
 version [f010       ]                               4=smfloat    10=datetime
 tabtype [a]  <T>able or <V>iew
 audpath [f011                            ]      NOTE: Add 256 to above for
         [f012                            ]            columns WITHOUT NULLS
}
end
TABLES
  systables
  syscolumns
ATTRIBUTES
f000 = systables.tabname, reverse, noentry, noupdate;
f001 = systables.owner, noentry, noupdate;
f002 = systables.dirpath, noentry, noupdate;
f004 = systables.tabid = syscolumns.tabid, queryclear, noentry, noupdate;
f005 = systables.rowsize, noentry, noupdate;
f006 = systables.ncols, noentry, noupdate;
f007 = systables.nindexes, noentry, noupdate;
f008 = systables.nrows, noentry, noupdate;
f009 = systables.created, noentry, noupdate;
f010 = systables.version, noentry, noupdate;
a = systables.tabtype, noentry, noupdate;
f011 = systables.audpath[1,32], noentry, noupdate;
f012 = systables.audpath[33,64], noentry, noupdate;

f013 = syscolumns.colname, reverse, noentry, noupdate;
f015 = syscolumns.colno, noentry, noupdate;
f016 = syscolumns.coltype, noentry, noupdate;
f017 = syscolumns.collength, noentry, noupdate;

INSTRUCTIONS
systables master of syscolumns

BEFORE ADD REMOVE OF systables syscolumns
ABORT

BEFORE EDITADD EDITUPDATE OF systables syscolumns
ABORT

end
{EOF tc_info.per}
