RE: Equivalent to Oracle's describe
Posted in 1998
I'm not sure whether it's the answer you want, but DB-Access can be used in
a non-interactive mode and understands the INFO command:
dbaccess dbase - <<!
INFO COLUMNS FOR sometable;
!
Note that INFO is not an ESQL/C command; it is understood only by DB-Access
and ISQL and is handled by those programs internally. It is fairly
straightforward to handle pre-IUS data types, but the IUS extended data
types are much more difficult.
Also, the SQLCMD program in the IIUG archives (http://www.iiug.org) can
show the column names and (pre-IUS) types of query results - use 'sqlcmd
-HT' or the 'headings on' and 'types on' built-in commands. You could
filch the conversion code from there. DB-Access doesn't display the types
of query results, of course.
The most important information comes from the ColType and ColLength columns
in the 'informix'.SysColumns table, but there is a lot of encoding of the
information. The Informix Guide to SQL: Reference has a chapter on the
system catalogue. What more do you want in the way of information? Having
the ESQL/C headers will often make it a little easier to understand what's
going on with the more complex data types (meaning DATETIME and INTERVAL).
Does anybody have code to interpret the extended IUS data types? If so,
can I see it?
Yours,
Jonathan Leffler (jleffler@visa.com) #include <bother.ms-exchange.h>
----------
From: James Cooper[SMTP:pixel@organic.com]
Sent: Monday, March 16, 1998 11:11 PM
I'm new to the Informix world, and miss the "describe" command in Oracle
that displays the column names and datatypes for a given table or view.
I realize that if I run dbaccess in its menu driven mode that I can get
this information, but for whatever reason I'm just not that into the fancy
ASCII menus.
Also, can anyone recommend a good reference for the Informix system
catalog? I imagine I could answer my first question above if I knew which
catalog tables to look in.