Find Informix table and column data using SQL query

I want to get Informix table table information and column information such as

  • table names
  • table column name
  • column data types
  • data type length (ex: if the column is varchar)
  • column restrictions

I can find table names and column names using this query to get table names

select tabname from systables 

to find the column name

SELECT TRIM(c.colname)   AS table_dot_column 
FROM "informix".systables AS t, "informix".syscolumns AS c 
WHERE t.tabname = 'agent_status'   
AND t.tabtype = 'T'
and t.tabid = c.tabid 
AND t.tabid >= 100  ; 

but I cannot find the data types and column constraints.

Can someone tell me an SQL query to get general information about the table above?

+5
source share
1 answer

! - , , ; , , , .

tabid owner , "informix".systables, systables ( MODE ANSI, ).

syscolumns , t.tabid >= 100, , , , . , , tabtype = 'T' .

. ; . coltype collength ( extended_d) . C SQLCMD sqltypes.ec. SQL ( ) $INFORMIXDIR/etc/xpg4_is.sql.

sysconstraints . SQLCMD ( sqlinfo.ec).

+3

All Articles