DB Names
Posted in 1992
Steven.J.Richardson@um.cc.umich.edu — — source: Informix-list mailing list archive (1991-1998)
Recently, I referred to a function which tells one the names of the databases of which an Informix engine knows; that function is "sqgetdbs()" and its use is illustrated below. #define MAXDBNAMES 64 #define AREA_SIZE 128 main() { int ndb, sqlcode, i; char *fnames[MAXDBNAMES], area[AREA_SIZE]; if (sqlcode = sqgetdbs(&ndb, fnames, MAXDBNAMES, area, AREA_SIZE)) printf("sqgetdbs() returned %d\\n", sqlcode); else { printf("%d databases\\n", ndb); for (i = 0; i < ndb; i++) printf("%s\\n", fnames[i]); } exit(sqlcode); } Steven J. Richardson/Merit Network, Inc.