2018年6月13日 星期三

[DB] Informix System Columns 應用



select * from SYSTABLES, SYSCOLUMNS 
where tabname your condition
and SYSTABLES.tabid = SYSCOLUMNS.tabid

因為工作環境關係, 用WHERE 條件式的JOIN 語法.


Table 1. The SYSCOLUMNS table
ColumnTypeExplanation
colnameVARCHAR(128)Column name
tabidINTEGERIdentifying code of table containing the column
colnoSMALLINTColumn number
The system sequentially assigns this (from left to right within each table).
coltypeSMALLINTCode indicating the data type of the column:
  • 0 = CHAR
  • 1 = SMALLINT
  • 2 = INTEGER
  • 3 = FLOAT
  • 4 = SMALLFLOAT
  • 5 = DECIMAL
  • 6 = SERIAL 1
  • 7 = DATE
  • 8 = MONEY
  • 9 = NULL
  • 10 = DATETIME
  • 11 = BYTE
  • 12 = TEXT
  • 13 = VARCHAR
  • 14 = INTERVAL
  • 15 = NCHAR
  • 16 = NVARCHAR
  • 17 = INT8
  • 18 = SERIAL8 1
  • 19 = SET
  • 20 = MULTISET
  • 21 = LIST
  • 22 = ROW (unnamed)
  • 23 = COLLECTION
  • 40 = LVARCHAR fixed-length opaque types 2
  • 41 = BLOB, BOOLEAN, CLOB variable-length opaque types 2
  • 43 = LVARCHAR (client-side only)
  • 45 = BOOLEAN
  • 52 = BIGINT
  • 53 = BIGSERIAL 1
  • 2061 = IDSSECURITYLABEL 2, 3
  • 4118 = ROW (named)
collengthAny of the following data types:
  • Integer-based
  • Varying-length character
  • Time
  • Fixed-point
  • Simple-large-object
  • IDSSECURITYLABEL
The value depends on the data type of the column. For some data types, the value is the column length (in bytes). See Storing Column Length for more information.
colminINTEGERMinimum column length (in bytes)
colmaxINTEGERMaximum column length (in bytes)
extended_idINTEGERData type code, from the sysxtdtypestable, of the data type specified in the coltype column
seclabelidINTEGERThe label ID of the security label associated with the column if it is a protected column. NULL otherwise.
colattrSMALLINT
HIDDEN
1 - Hidden column
ROWVER
2 - Row version column
ROW_CHKSUM
4 - Row key column
ER_CHECKVER
8 - ER row version column
UPGRD1_COL
16 - ER auto primary key column
UPGRD2_COL
32 - ER auto primary key column
UPGRD3_COL
64 - ER auto primary key column
PK_NOTNULL
128 - NOT NULL by PRIMARY 

[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

2018年6月11日 星期一

使用notepad++ 把傳統命名改為JAVA 命名

傳統的命名方式為

cust_name, user_email 等.

JAVA變數命名為駝峰式命名 Camel-Case 也稱為駝峰式大小寫.

可以使用notepad++ 正規表示法取代的方法變更命名.


Before:

cust_name, user_email

尋找內容:[_]{1,1}([a-z])
取代為:\U$1


After:
custName, userEmail

Ads

Seo Services