Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!think.com!spool.mu.edu!uunet!cimshop!davidm From: cimshop!davidm@uunet.UU.NET (David S. Masterson) Newsgroups: comp.databases Subject: Re: Informix ESQL/C with C++ Message-ID: Date: 25 Apr 91 16:46:42 GMT Article-I.D.: uunet.CIMSHOP!DAVIDM.91Apr25094642 References: <741@strengur.is> Sender: davidm@cimshop.UUCP Distribution: comp Organization: Consilium Inc., Mountain View, California Lines: 30 In-reply-to: hpe@cs.hut.fi's message of 25 Apr 91 08:12:27 GMT >>>>> On 25 Apr 91 08:12:27 GMT, hpe@cs.hut.fi (Hannu Peltonen) said: Hannu> We use Informix 4.0 OnLine ESQL with HP C++ 2.0 (i.e., AT&T 2.0 Hannu> cfront). We have written a header file that declares both the Hannu> functions to be called by the application programmer and the functions Hannu> called from the code generated by the preprocessor. Hannu> The list of preprocessor functions may not be complete; we have added Hannu> functions as we have encountered them in the generated code. Hannu> To compile a C++ program with embedded SQL, we use a simple command Hannu> script. The script removes C++ style comments ("// xxxxx"), which Hannu> confuse the Informix preprocessor, runs the preprocessor, and finally Hannu> compiles the C++ program. Wouldn't it be simpler (and less prone to problems when either C++ or ESQL/C are upgraded) to embed the SQL in C-only functions and call those functions from C++? That way the C++ stays in a C++ world and the ESQL/C preprocessor is only used on stuff it was meant to be used on (C with embedded SQL). Having taken Hannu's approach with C++ and VAX RDB, I can tell you that it was no pretty picture when either VAX RDB or C++ were upgraded. If I could have done it over, I think the C-only functions would be a more stable route until the various vendors come up with real support for SQL/C++ code. -- ==================================================================== David Masterson Consilium, Inc. (415) 691-6311 640 Clyde Ct. uunet!cimshop!davidm Mtn. View, CA 94043 ==================================================================== "If someone thinks they know what I said, then I didn't say it!"