Re: Require DB list from sqlturbo directly, HOW
Posted in 1994
In article 8u5@worak.kaist.ac.kr, cdlim@tp22.etri.re.kr (ChaeDeok Lim) writes: > > On doing my project, I faced with a problem: How can I get db list > (DB names) from sqlturbo? I tried to use SQL library, but the key > functions were hidden in front-end tool(isql) and there were just > basic functions in libsql4.a and libfesql.a. That's not enough to > use them for me. I heard that there should be other preliminary > operations and so on. > > Is there anybody who knows how to get db list directly, if not, even > indirectly? > > If YOU know, please DON'T HESITATE! > The Best of Thanx to YOU! > > I would be really happy for your informing me. You ca From cinsop@frodo.nask.org.pl ("Centr. Instytut Ochrony Pracy") Newsgroups: comp.databases.informix Subject: Re: List of Databases from ESQL/C Date: Fri Feb 25 00:44:49 PST 1994 On Thu, 24 Feb 1994, Neil Larson wrote: > Any one out there know how to get a list of all the databases on the system? > Informix does this when you start isql to build the menu of databases to > select. I have tried to select dbname from the systables, but the field > appears to be empty. Other information, Ver. 4.1, AIX. > > Thanks, Neil Larson There is a way to get the dblist from the database. I hope the following helps. #define MAXDATABASES 256 /* space for pointers */ #define MAXDBSPACE (15 * MAXDATABASES) /* space for strings */ ... char *dbnamespace[MAXDATABASES]; char area[MAXDBSPACE]; int numbases=0; int code=sqgetdbs(&numbases, dbnamespace, MAXDATABASES, area, MAXDBSPACE); if (code==0 && numbases >0) { int i; for (i = 0; i < numbases; ++i) printf("%s\\n", dbnamespace[i]); } Note that you have to decide in advance how many databases you are prepared to hear about (isql sets a limit of 100 which is too small on our site!)