Search code examples
sqlinformix

How can get full name from INFO TABLES at Informix DB


I'm not very good with cli and I need help getting the full names of restricted tables + , for example: aardialprefixmatr+

> info tables;

Table name

aardialprefixmatr+ aarneighborhood    activationcode     activationcodetbr 
advanceddevicecon+ agentnumplandynam+ alarmconfig        alarmmonitorcapab+
alarmusertext      alternatenumber    analogaccess       analogaccessport  
apdiscoveryschedu+ apdiscoveryserver  applicationdialru+ applicationuser   

It would be nice to display them in one column


Solution

  • The simplest technique is to run the query directly instead of using INFO TABLES:

    SELECT tabname FROM "informix".systables WHERE tabid >= 100;
    

    The system catalog tables have numbers less than 100. You could specify AND tabtype = 'T' if you want table names only rather than including views and synonyms too. You can specify the order that the rows should appear in (ORDER BY tabname or ORDER BY tabid or ORDER BY owner, tabname, etc). That will show the data with the column name (tabname) and the value (the table name):

    tabname  dual
    
    tabname  elements
    
    tabname  compound
    
    tabname  compound_component
    
    tabname  isotopes
    
    tabname  named_isotopes
    
    tabname  megalopolis_created_by_ozymandias_in_times_uncertain_but_distant_and_n
             ot_called_atlantis