Re: How do I rename a database?
Posted in 1992
Path: emory!wupost!cs.utexas.edu!sun-barr!news2me.ebay.sun.com!exodus.Eng.Sun.COM!appserv.Eng.Sun.COM!sun!amdcad!weitek!pyramid!infmx!news From: cortesi@informix.com (David Cortesi) Newsgroups: comp.databases.informix Message-ID: <1992Mar6.212631.28627@informix.com> Date: 6 Mar 92 21:26:31 GMT References: <1992Mar6.205843.26485@informix.com> Sender: news@informix.com (Usenet News) Reply-To: cortesi@informix.com Organization: Informix Software, Inc. In article <1992Mar6.205843.26485@informix.com> davek@informix.com (David Kosenko) writes: > >In article <1992Mar5.213646.14124@cs.odu.edu> bander@oswine.cs.odu.edu Writes: > > One point: if you do use a variable database name, then you > cannot use LIKE clauses in your variable definitions (as it needs > to know what database to use to resolve the definition). Not the full story: in 4GL the LIKE clause is evaluated at compile time only. You don't really care which database is used for this purpose as long as the schemas are all the same. So you can have a declarative DATABASE test_dbs at the head of a 4GL program, and that is the database that would be used to expand LIKE clauses. But then you could write MAIN DEFINE dbname CHAR(18) LET dbname = ARG_VAL(1) DATABASE dbname ... and as long as the specified database had the right schema, so that a SELECT * INTO record.* still matched up right, no problem. > >To help me get around a lot of coding changes there is only ONE file > >that has the DATABASE statement in it - globals.4gl. And of course, > >all the screen forms have it as well (there's no getting around that). > > You could use FORMONLY fields, though that makes populating > the screen more of a pain. Again, the form compiler picks up table names and column attributes when it is compiling the form. All that matters for a form specification is that the schema of its DATABASE be the same as the schema of the database that is open at run time.