Re: Using LIKE to define records in 4GL
Posted in 1996
johnl@informix.com (Jonathan Leffler) wrote: >I'm going to pick up on a common misconception which is tangential to the >rest of the discussion. Again, this has been dealt with previously, but it >bears reiteration. - Snip of Mark Denhams original comments >If your programs need to run in a multi-database environment, you have to >write them more carefully than you do in a single-database environment. - Snip of some useful stuff >This technique means that you can have test and production versions of the >database, possibly with the same name in different OnLine systems, or with >different names in the same OnLine system. You can have a separate >database for each company in a group run by a holding company, etc. - Snip of ancilliary comments Just following along on this tangent ... We use an alternative to Jonathan's system, whereby we have a separate globals file for each system, which defines the Database and a data buffer for each table which we use to retrieve database info into. The common source lies in a separate directory (in the DBPATH - we use RDS) whereas the compilation directory has the globals file and any code that is unique to this system. (This system has some drawbacks, the most obvious one is that object code is required for all the different systems, but it doesn't have to be retained, and besides disk space is cheap :). We have no problems using LIKE, but it is forbidden to use the "RECORD LIKE table.*" and the "SELECT * FROM" constructs. It is the * that causes problems, rather than the LIKE.