Re: Listing all databases in an instance of On-Line
Posted in 1995
I never saw the original article, but if someone wanted a way to list all the databases in the OnLine system, here's a function call (and supporting code) that should be easier than parsing the output of a tbcheck -pe: #define MAXDBNAMES 8 #define AREA 128 main() { int ndb, sqlcode, i; char *fnames[MAXDBNAMES], area[AREA]; if(sqlcode = sqgetdbs(&ndb, fnames, MAXDBNAMES, area, AREA)) printf("error code %d from sqgetdbs\\n", sqlcode); else { printf("There are %d databases\\n", ndb); for(i=0; i<ndb; i++) printf("[%s]\\n", fnames[i]); } } June ---- June Tong Informix Software ---- ---- junet@informix.com On-Site Regency Support at SAP ---- ---- Informix: (415)926-6140 SAP: (415)286-6808 ----