Accessing multiple databases from same process
Posted in 1997
I thought I could accomplish this by setting environment variables before opening the database. After wasting 15 minutes determining that Informix failed to supply fgl_putenv() to accompany fgl_getenv(), I resorted to ESQL/C. However when I tried on Informix 5.??, my first putenv("TBCONFIG=tbconfig_prd") allowed me to access the production database (even though I ran the program from development), but after I closed the database, issued my 2nd putenv("TBCONFIG=tbconfig_dev"), and then re-opened the database, I was still accessing production. I added a call to getenv() just to make sure I was really setting the environment the 2nd time round, which I was. [I know I did this a couple of years ago, but maybe I used a 2nd process which set the environment before calling the program which did the work, I can't remember for sure.] Confounded by this, I took the program to a machine running Informix 7.2?, changing TBCONFIG to ONCONFIG, and adding DBSERVERNAME, INFORMIXSERVER, and DBSERVERALIASES, as these seemed to be the relevant environment variables which changed between databases, but this time, not even the first round of putenv()s had any affect. Any idea of what I'm missing? -- - Danny Wright danwright@bigfoot.com #include <stddisclaimers.h> Idiot, n.: A member of a large and powerful tribe whose influence in human affairs has always been dominant and controlling. - Ambrose Bierce, "The Devil's Dictionary"