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!davek From: davek@informix.com (David Kosenko) Newsgroups: comp.databases.informix Keywords: database, rename Message-ID: <1992Mar6.205843.26485@informix.com> Date: 6 Mar 92 20:58:43 GMT References: <1992Mar5.213646.14124@cs.odu.edu> <1992Mar6.033543.6688@nas.nasa.gov> Sender: news@informix.com (Usenet News) Organization: Informix Software, Inc. In article <1992Mar6.033543.6688@nas.nasa.gov> jcarter@sun204.nas.nasa.gov (John R. Carter Sr.) writes: >In article <1992Mar5.213646.14124@cs.odu.edu> bander@oswine.cs.odu.edu Writes: >> can I rename a database? > >I really don't think so. The workaround you describe is pretty much >what I think has to be done. I've looked into this before and gave up >on it. I have two databases - one for testing and one for production. >I found this necessary for two reasons: 1) you don't want to be testing >on your production database and 2) the DATABASE statement doesn't allow >for variables. The DATABASE statement in 4gl and esql/c DOES allow for variables. For example, in the 4gl code fragment: DEFINE dbname CHAR(18) DATABASE dbname the contents of the variable dbname will be used for the database statement. In esql/c, you can use: $char dbname[18]; $database $dbname; This would be the preferred method for the original question. However, with the volume of code it sounds like is there, I gather this would not be easy to change. 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). >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. Dave Kosenko Informix Software, Inc. -- Disclaimer: These opinions are not those of Informix Software, Inc. ************************************************************************** The heart and the mind on a parallel course, never the two shall meet. -E. Saliers