Re: DB Definition Reference
Posted in 1996
Topics: Stored Procedures & SPL, Connectivity: ESQL/C, 4GL & Embedded SQL
Mark R. Ainis wrote: > > ----------- Posted news begins ---------------- > Dear netters, > > We have an application that consists of Informix 4gl programs on our HP machine. > In all of the source codes, we have record declarations that reference > current database table definitions using the LIKE key word. A sample of > the source codes is attached below. The problem arises during compiling. > The compiler must know the database name explicitly specified in the fi > rst line of the codes in order to define the record definitions. Is there a > known way of eliminating the hard-coded database name in the source such as > passing the name to compiler during compilation? > Sorry, my english is poor. To eliminating the hard-coded database name in the source try it: name of the database put into one global file - g_dbs_name.4gl ------------------ DATABASE your_database # Without GLOBALS and END GLOBALS statement # I get error in other modules GLOBALS END GLOBALS ----------------------------------- and use it in the multiple modules - module1.4gl --------------------- # don`t use DATABASE statement here # database name is in the global file "g_dbs_name.4gl" GLOBALS "g_dbs_name.4gl" MAIN DISPLAY "main module" CALL f1() END MAIN ----------------------------------- - module2.4gl --------------------- GLOBALS "g_dbs_name.4gl" # you may use multiple globals file GLOBALS "g2.4gl" FUNCTION f1() DISPLAY "Hallo" END FUNCTION ----------------------------------- Now is database name in the one file and is simple to change it. -- Jiri Lisicky CD CIT Olomouc e-mail: lisicky@cit.cdrail.cz Jeremenkova 42 phone: +42-068-5507 318 Olomouc, Czech Republic