Consultor Eletrônico



Kbase P15233: How to compile code when tables may or may not be in databas
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   30/04/2003
Status: Unverified

GOAL:

How to compile code when tables may or may not be in database ?

GOAL:

Depending on the customer where application is deployed some table could be or not in database. How to compile the code in this case?

FIX:

The following example will work when code is compiled against 2 different databases one at a time.
1. create 2 folders ./db1 and ./db2
2. in ./db1 place myincl.i containing
&GLOBAL-DEFINE mydb "db1"
3. in ./db2 place myincl.i containing
&GLOBAL-DEFINE mydb "db2"
4. your .p code will have
{myincl.i}
&IF "{&mydb}" EQ "db1" &THEN
/* access tables from db1 */
&ENDIF
&IF "{&mydb}" EQ "db2" &THEN
/* access tables from db2 */
&ENDIF
5. to compile .p against db1 database start your progress session with ./db1 in PROPATH, for db2 database ./db2 should be in PROPATH