RE: 4GL - Database Names
Posted in 1996
Your only option is to replace the database name hard coded in you pgms with a char variable. Fill this with the actual db name thru the command line [FYI arg_val(), FM 4gl ref vol 1, chap 6] or via an enviromental variable [fgl_getenv(), FN 4gl supplement]. In the first case, you can use num_args() to see that an argument has actually been passed. In the second, if the env var is not defined, you user is out of luck! As for changing the hard coded name in 300+ pgms, try the following for i in list_of_your_programs do sed -e "s/old_db_name/new_db_var/gw tmp1$$" $i > tmp2$$ if [ -n "`cat tmp1$$`" ] then mv tmp2$$ $i fi rm tmp?$$ done test the above before you run it (if it's wrong, the problem is yours and not mine :-) HTH Marco. ____________________________________________________________________________ rem radioterapia, which I immeritately manage, seldom agrees with what I say marco greco (Catania, Italy) Work: marcog@ctonline.it rem radioterapia 39 95 447828 fax 446558 (was mar.greco@agora.stm.it) Achea 39 95 503117 --- On Mon, 30 Sep 1996 08:33:57 -0600 Edward Bidinotto <bidinott@ucar.edu> wrote: I am working in an environment where the programmers have hard-coded the database name in their 4GL code. We are running Informix 5.0 and I wanted to know how can I pass in a different database name on the fly to override the hard-coded one that currently exists in all their programs. I'm sure there is a variable that can be read in or passed in to say what database name I want. The only other option is for the programmers to take this hard-coded database name out of their 300+ programs. Any suggestions would be appreciated. Tks Ed -- ---------------------------------------------------------------------------- Ed Bidinotto bidinott@ucar.edu -----------------End of Original Message-----------------