Path: utzoo!mnetor!uunet!vsi!friedl From: friedl@vsi.UUCP (Stephen J. Friedl) Newsgroups: comp.databases Subject: Re: ESQL/C preprocessor bugs/suggestions (To: Informix Software) Message-ID: <607@vsi.UUCP> Date: 26 Apr 88 06:03:41 GMT References: <1333@mcgp1.UUCP> Organization: V-Systems, Inc. -- Santa Ana, CA Lines: 37 Keywords: ESQL/C, INFORMIX(R)-SQL Summary: ESQL preprocessor In article <1333@mcgp1.UUCP>, fst@mcgp1.UUCP (Skip Tavakkolian) writes: > 1) The first bug has to do with the esqlc preprocessor changing the > host variables to all lower case. For example: > > $char FooBar[512]; > > $select foo_bar from boobaz into $FooBar ; > if (FooBar[0] == 'x') do_somthing(); /* c compiler complains about > FooBar not being defined */ > > The esqlc preprocessor changes the ``FooBar'' to ``foobar''. Also another > point in the above example is that, you can't use somthing like BUFSIZ instead > of hard coded ``512'' for the size of the array for the same reason (i.e > ``bufsiz'' is not ``BUFSIZ''). The preprocessor appears to take neither `BUFSIZ' nor `bufsiz'; array dimensions must be numeric. This is presumably because esqlc doesn't process #include and #define directives, so it has no way of knowing the length without a simple digit string. This is a bummer because it requires magic all throughout the code :-(. As an aside, it's helpful to declare string host variables as: $string foobar[512]; rather than $char foobar[512]; The former asks SQL to strip trailing blanks from the fetched column and insure that a NUL appears at the end. This is really handy; we almost never need to use $char host variables. Does anybody at Informix Corp. read this newsgroup and accept suggestions and bug reports via email? -- Steve Friedl V-Systems, Inc. 3B2 Wizard friedl@vsi.com {backbones}!vsi.com!friedl attmail!vsi!friedl