Re: Using LIKE to define records in 4GL
Posted in 1995
In article <3vbden$5nh@cssun.mathcs.emory.edu>, Nils.Myklebust@CCMAIL.telemax.no wrote: > >Of course you shouldn't use LIKE. >The problem is exactly what to do instead. >We have many old programs I wrote a long time ago when I didn't >relize all the problems, and that shall be changed as they >are updated for other reasons. > >To write out every record definition explisitly wherever it >is needed and keeping selects in sync is a real pain. Particularly >as we have hundreds of programs and over 100 tables. > Nils, Look at example 30, ex30.4gl in the distribution from INFORMIX. It has the code in it to help you build explicit record definitions. You could write a tool to build these explicit record definitons with this program, as I have done, and available in my FREE tool kit. You can also refer to the ESQLC manual which has an example of how to get a column data type from the db. This method might be a bit more efficient. I have found the use of the cheezy LIKE syntax useful from time to time, but I find the rule that others have posted, NOT to use it, is best, even though explicit declarations mean a bit more tedium if the tables or columns change frequently. You could always protoype applications with the LIKE syntax, and then explicitly code data types in the finished app. Tim -- \\\\|// (O|O) ==============================---o00--(_)--00o---============================ Tim Schaefer tschaefe@gate.net http://www.gate.net/~tschaefe Make America great again: Abolish the IRS and reinstitute public hangings =============================================================================