How do you choose database at RUNTIME in r4gl?
Posted in 1994
Topics: Installation, Setup & Upgrades, Connectivity: ESQL/C, 4GL & Embedded SQL, Platform-Specific Issues
SCENERIO: We have two systems, production and development. ISTAR is installed on both systems so we can perform remote queries. We have scores of 4gl reports that share a common 4gl GLOBAL header file. When we wish to access data that is on production, we change the statement database lotsadata to database lotsadata@production and recompile the program. When we run the program on development, we will get production data. This causes problems because we have several programmers working in Interactive 4gl (OnLine 4.11 for AIX 3.2.5) and we step on each other. It is difficult to know where a compiled program will pull its data from by looking at the P code, and the "database xxxx@yyyyy" statement causes contention between programmers needing data from development and those needing to access production. Is there a way that we can specify the database name at run time, instead of compile time? Maybe make r4gl look at the contents of a UNIX environmental variable, DBNAME? I have done some playing around and haven't found a nice solution. If you put the "database" statement in the MAIN block, you can change databases in the program, but I don't want to do this to 200 programs. I would rather find a way to put the database selection in the shared GLOBAL header... Any tips would be greatly appreciated. Thanks, Mike Lester Programmer/Analyst USAA Investment Management Co.