home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!europa.asd.contel.com!emory!uunet.UU.NET
- From: carsmax!carshp.!ken@uunet.UU.NET (Ken Evilsizor)
- Newsgroups: comp.databases.informix
- Subject: Re: Way to get list of databases ?
- Message-ID: <9245@emory.mathcs.emory.edu>
- Date: 30 Jul 92 13:53:13 GMT
- Sender: walt@mathcs.emory.edu
- Reply-To: carsmax!carshp.!ken@uunet.UU.NET (Ken Evilsizor)
- Lines: 47
- X-Informix-List-ID: <list.1347>
-
- Tony Heskett writes:
- } Jeff White writes:
- }
- } } Does someone know of a way (easy or not, but needs to be executeable
- } } from command line, not interactive) to return a list of all the available
- } } databases?
- }
- } Well, someone does. From Ken Evilsizor a little while ago:
- } ...
- } I get the feeling that this *hasn't* been posted, but that you'd get
- } a fair way by playing with sqgetdbs(). Otherwise, mail him & grovel ;-)
-
- I didn't ever post it since there was a copyright message at the top of the
- page I had. The information was posted in X-Informix-List-Id: <list.1287>
- by Steven J. Richardson. Here it is:
-
- } 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.
-
- ---------------------------------------------------------------------------
- Ken Evilsizor Email: uunet!uceng!cinnet!carsinfo!ken
- CARS Information Systems
- 4000 Executive Park Dr. Disclaimer: All opinions expressed are
- Cincinnati, OH 45241 definitely my own.
-