RECORD LIKE tbl.* emulation in ESQL/C
Posted in 1992
Path: emory!sol.ctr.columbia.edu!zaphod.mps.ohio-state.edu!think.com!wupost!uunet!ispd-newsserver!kodak!music!amiano From: amiano@music.Kodak.COM (Mitch Amiano) Newsgroups: comp.databases.informix Message-ID: <1992Feb7.200410.14990@kodak.kodak.com> Date: 7 Feb 92 20:04:10 GMT Sender: amiano@music (Mitch Amiano) Organization: Eastman Kodak Co., Rochester, NY In mulling over the maintenance consideration of ESQL/C code, it struck me that one way to cut down on code reworking would be to have a construct in ESQL/C which works like the I4GL Record Like clause. The basic idea is to generate a variable as a C struct, with members derived from a given table. I have written a shell/sed script to do this, with some success. (as with many code generators, user changes to the output file must be manually edited into successive generations of output files). However, once the struct definition is made, there is no way to reference the members as a group (ala I4GL's Var.* construct), short of creating a bunch of macro's - one for each table's struct - which expands into a list of members with the passed variale name prepended to each. Something like #define M_tablename(x) x.column1, x.column2 which works well, but still adds more code to maintain. Does anyone know of existing ESQL/C constructs which could be used instead; or perhaps a similiar system of structs and macro's ? ---------------------------------------------------------------------------- | Mitch Amiano Current Work Phone: 716-477-3506 | | Software Contractor | | Rochester, NY | | 716-226-2024 amiano@music.kodak.com | | | | "We were having an ugly face contest, but we're done now. You won."| | - Calvin to his dad, in Calvin & Hobbes | | | | 8-{0 ----glasses and a mustach | | :-o... ----dribbler | ----------------------------------------------------------------------------