This is a discussion on Columns in each table within the Informix forums, part of the Database Server Software category; --> Hello -- I am a newbie to Informix, and will start a contract tomorrow to write Crystal Reports on ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hello -- I am a newbie to Informix, and will start a contract tomorrow to write Crystal Reports on an Informix db. Can anyone suggest SQL code to obtain the following information from an Informix database?: Table, Column, DataType, Length, Description (?) I use the following code in MS SQL Server SELECT SUBSTRING(table_name,1,20) AS "Table", SUBSTRING(column_name,1,30) AS "Column", SUBSTRING(data_type,1,13) AS "DataType", ISNULL(character_maximum_length, ' ') AS "Length", STR(numeric_precision) AS "Precision", numeric_scale AS "Scale", CONVERT(nvarchar(150), ISNULL(s.value, ' ')) AS Description FROM INFORMATION_SCHEMA.COLUMNS i_s LEFT OUTER JOIN sysproperties s ON s.id = OBJECT_ID(i_s.TABLE_SCHEMA+'.'+i_s.TABLE_NAME) AND s.smallid = i_s.ORDINAL_POSITION AND s.name = 'MS_Description' WHERE OBJECTPROPERTY(OBJECT_ID(i_s.TABLE_SCHEMA+'.'+i_s. TABLE_NAME), 'IsMsShipped')=0 AND table_schema = 'DBO' AND table_name NOT LIKE 'sys%' AND table_name NOT LIKE 'dtprop%' ORDER BY table_name, ordinal_position Can you also tell me in what Informix component to enter such SQL code? In SQL Server, for example, I could enter it in Query Analyzer or create a query in the Management Console. Thanks for any help. Larry Mehl |