2018年6月13日 星期三

[DB] Informix SystemTable 應用

Informix 中,可以用下列的指令取得Table Name,

select tabname from systables
where tabname your condition

Table 1. SYSTABLES table column descriptions
ColumnTypeExplanation
tabnameVARCHAR(128)Name of table, view, synonym, or sequence
ownerCHAR(32)Owner of table (user informix for system catalog tables and usernamefor database tables)
partnumINTEGERPhysical storage location code
tabidSERIALSystem-assigned sequential identifying number
rowsizeSMALLINTMaximum row size in bytes ( < 32,768)
ncolsSMALLINTNumber of columns in the table
nindexesSMALLINTNumber of indexes on the table
nrowsFLOATNumber of rows in the table
createdDATEDate when table was created or last modified
versionINTEGERNumber that changes when table is altered
tabtypeCHAR(1)Code indicating the type of table object:
  • T = Table
  • E = External Table
  • V = View
  • Q = Sequence
  • P = Private synonym
  • S = Public synonym
(Type S is unavailable in an ANSI-compliant database.)
locklevelCHAR(1)Lock mode for the table:
  • B = Page and row level
  • P = Page level
  • R = Row level
npusedFLOATNumber of data pages that have ever been initialized in the tablespace by the database server
fextsizeINTEGERSize of initial extent (in KB)
nextsizeINTEGERSize of all subsequent extents (in KB)
flagsSMALLINTCodes for classifying permanent tables:
ROWID
1 - Has rowid column defined
UNDER
2 - Table created under a supertable
VIEWREMOTE
4 - View is based on a remote table
CDR
8 - Has CDRCOLS defined
RAW
16 - (Informix) RAW table
EXTERNAL
32- External table
AUDIT
64 - Audit table attribute - FGA
AQT
128 - View is an AQT for DWA offloading
VIRTAQT
256 - View is a virtual AQT
siteVARCHAR(128)Reserved for future use
dbnameVARCHAR(128)Reserved for future use
type_xidINTEGERCode from sysxtdtypes.extended_idfor typed tables, or 0 for untyped tables
am_idINTEGERAccess method code (key to sysamstable)
NULL or 0 indicates built-in storage manager
pagesizeINTEGERThe pagesize, in bytes, of the dbspace (or dbspaces, if the table is fragmented) where the table data resides.
ustlowtsDATETIME YEAR TO FRACTION (5)When table, row, and page-count statistics were last recorded
secpolicyidINTEGERID of the SECURITY policy attached to the table. NULL for non-protected tables
protgranularityCHAR(1)LBAC granularity level:
  • R: Row level granularity
  • C: Column level granularity
  • B: Both column and row granularity
  • Blank for non-protected tables
statlevelCHAR(1)Statistics level
  • T = table
  • F = fragment
  • A = automatic
statchangeSMALLINTFor internal use only

沒有留言:

張貼留言

Ads

Seo Services