Re: selecting databases on command line with fglgo
Posted in 1994
kerry@kcbbs.gen.nz (Kerry Sainsbury) writes: >In article <TH2mTc1w165w@cssnet.sanford.nc.us>, >david@cssnet.sanford.nc.us (J. David Schronce) wrote: >> ... >> fglgo progname -d database only it doesn't override the line in the >> progname.4gl that says: database company1 >> >> Is there any "quick'n'dirty" way to override the database specified in >> the 4gl file? >Not really. >If you have some sort of common initialization routine at the start of each >program (highly recommended for setting isolation levels, lock modes, >options, help files, logfiles etc etc) then you could include: > LET l_database = arg_val(1) > DATABASE l_database An attempt to clarify: The DATABASE statement at the top of the module (above all functions) is there essentially for the compiler, so it knows where to find any DEFINE ... LIKE syntax. Using a DATABASE statement within the MAIN function as Kerry suggests will override the DATABASE statement at top. There is slight performance overhead; the top DATABASE is opened as startup, and then closed when the 2nd one is reopened. If you don't use the DEFINE ... LIKE syntax, you can forgo the top DATABASE statement. ======================================================================= Dennis J. Pimple dennisp@informix.com Opinions expressed Senior Consultant -------------------- are mine, and do not Informix Software Inc Voice: 303-850-0210 necessarily reflect Denver Colorado USA Fax: 303-779-4025 those of my employer. >Then when you run the program use: > fglgo program <database_name> >Note that'll you'll need to create a "company1" database even when running >against company2 data, but it need not have any tables in it. >--------------------------------------,------------------------------------- >Kerry Sainsbury, kerry@kcbbs.gen.nz | THE INFORMIX FAQ >Quanta Systems, Auckland, New Zealand | kcbbs.gen.nz:/informix/* > | mathcs.emory.edu:/pub/informix/faq/* >+64 9 377-4473 (work) 276-5546 (home) | quasar.ucar.edu:/?