Checking for application correctness
Posted in 1991
Path: emory!swrinde!sdd.hp.com!cs.utexas.edu!uunet!psinntp!uupsi!gdc!nms!bergquis From: bergquis@nms.gdc.com (Brett Bergquist) Newsgroups: comp.databases.informix Message-ID: <412@wimpy.nms.gdc.com> Date: 31 Oct 91 14:14:04 GMT Organization: General DataComm, Middlebury CT My environment: Informix SE Informix ESQL/C SunOS I have a database in which all tables and colums are created when the database is created. There is no dynamic creation of tables or columns. Using ESQL/C, I have no way of determining at compile time whether or not I have mispelled/mistyped columns or table names. This pushes the detection of simple syntactical errors from compilation until runtime. In an effort to solve this and other limitations with the ESQL/C preprocessor, I have developped a script which passes the source through the C preprocessor first, and then through a filter looking for mispelled/mistyped columns and tables. We have a header file in which #defines are assigned to each column and table name. The #define always ends in a '$' so that it can easily be detected in the source by the filter. Any variable found ending in a '$' after the C preprocessor pass must be a mispelled column or table. This technique works most of the time, but failes if the '$' is forgotten in the source. The ESQL/C preprocessor blindly uses the #define name as the name of a column or table once again. Passing the source through the C preprocessor first has a side benifit of allowing all the standard CPP macro capability to be used inside an ESQL/C source. The ESQL/C preprocessor macro capability is severly limitted. I which Informix would take one of the public CPP sources and add the ESQL/C code generation to it, leaving the capabilities of the CPP untouched. Does anyone have any ideas for a solution to this problem? -- Brett M. Bergquist, Principal Engineer | "Remind me" ... "to write an General DataComm, Inc., | "article on the compulsive reading Middlebury, CT 06762 | of news." - Stranger in a Strange Land Email: bergquis@nms.gdc.com