Find Database Names from an ESQL/C Program

If you have access to ESQL/C, there is a somewhat more elegant approach to determining the names of databases. The following program utilizes an undocumented function in ESQL/C. As such, the function is subject to change at any time by Informix. As a general rule, Informix does not recommend that users use undocumented functions and they take no responsibility for any problems that you may have in the use of undocumented functions.

Just remember that Informix may change this at any time. Until then, this program is much faster than the find_db_names shell script.

This program is called find_db_names.ec:

 main() { #define MAXSPACES 256#define MAXSTRINGS (15 * MAXSPACES) char *name[MAXSPACES]; char space[MAXSTRINGS]; ...

Get Informix DBA Survival Guide, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.