Re: ESQL question
Posted in 2000
Lora
Sure there is. There exists the sys* tables, eg systables, syscolumns contain
descriptions of tables and columns respectively. You can see the schemas for
these tables using dbaccess. To get a complete list use this SQL:
select tabname from systables where tabid < 100;You will also find descriptions of these tables in one of the SQL manuals
(Tutorial, Syntax and Reference - not sure which one, offhand).
Yes, ESQL/C supports dynamic SQL, so you should be able to use it to send
dynamic (prepared at runtime queries) to the server. I am assuming you were
really just looking for the table names, though.
I dont understand the part about the comparing to files that contain create to
determine the version. Do you mean the version of the application the database
refers to? If so, you would probably be better of maintaining the version number
in an application table somewhere, and arranging for your install script to
automatically populate the version number every time you run the install script
on the database.
PS - didn't know ragingbull used Informix.
Sujit
lora@ragingbull.com on 01/21/2000 07:17:16 AM
Please respond to lora@ragingbull.com
To: informix-list@iiug.org
cc:
Subject: ESQL question
Hi,
I'd like to know if there is a way via a C program
or a script to query a current Informix database and
get a list of all schema tables and fields. Then I'd like
to compare this list against several files that contain "create"
statements to determine what database version I am using.
Can dynamic ESQL/C be used to get a list of all the
tables that exist for a current database and all the fields for
each of the tables? Note that I am not interested in the
# of records for each table, just the schema info.
Thanks for any info or pointers!!
Email lora@ragingbull.com
Sent via Deja.com http://www.deja.com/
Before you buy.