Hello Informix users !
In the past I got very good answers to my questions I did ask here.
Thanks a lot for those answers !
So I am asking you for help, again.
We did use, and in fact are still using, Informix Version 2.10 on the
NCR-Tower to develop applications for our customer.
A co-worker wrote all the database related stuff in C using ESQL/C.
He used a mix of upper and lower-case characters for the host variables.
Now, the ESQL preprocessor which came with 2.10 converts all host-variables
to lower case characters. Therefore, he had to use the lower-case variant
of the host variables whenever he is using simple C (i.e. no ESQL involved).
Why he didn't use all lower-case every time ? I don't know !
Now, the ESQL preprocessor which comes with 4.x/5.x does not do this conversion
and I couldn't find neither a tool nor an option of ESQL to do this
upper-case to lower-case conversion. The preprocessor, of course, complains
about undefined variables (in the C part of the code, that is).
Because there are a lot of files containing this type of ESQL/C code I would
like to get a tool (or an - undocumented - option for ESQL) to do the
conversion of all host-variables in an ESQL statement (declaration or
usage in a select, update, etc.) to all lower-case.
I can't use a mix of upper and lower-case characters because the same code
must run (and compiled) under the old (2.10) and the new (4.x/5.x) version
of Informix.
Here is an example of the code, so you can see what my problem is:
[...]
$string DatabaseError; /* defining the host variable */
[...]
databaseerror = GermanDatabaseErrorText; /* host variable in C */
[...]
databaseerror = FrenchDatabaseErrorText; /* host variable in C */
[...]
$select from ... into ... where text = $DatabaseError; /* host var. in esql */
[...]
If somebody has a tool to do the conversion (sed, awk, etc. is fine, perhaps
even perl, although I have to port it to Interactive UNIX, first)
please mail (or post) information about it to me.
Many thanks in advance,
Norbert.
--
Norbert Bladt, Ascom Autelca AG, Worbstr. 201, CH-3073 Guemligen, Switzerland
Phone: +41 31 999 65 52 FAX: +41 31 999 65 44
Mail: nbladt@autelca.ascom.ch UUCP: ..!uunet!mcsun!chsun!hslrswi!aut!nbladt