Re: Linking ESQL & 4GL
Posted in 1994
>From: craigl@MCS.COM (Craig Ludington) >Subject: Linking ESQL & 4GL >Date: 12 Jul 1994 10:42:46 -0500 >X-Informix-List-Id: <news.7565> > >We're having a problem doing things in ESQLC, when linked with 4GL code, >that we can easily do with programs entirely coded in ESQLC. > >We think it's a linkage problem. It is. >An example is creating a database on a remote machine. The syntax > > create database "//swconv/" ... > >to create the database is refused by 4GL, so we wrote it in ESQL, and it >works fine. Fine, that is, until we link with the 4GL libraries, and then >it fails. It would. >We've determined that this syntax requires use of the Relay Module process, >which is never started from 4GL. I've hypothesized that the functionality >of the Relay Module is built into the 4GL libraries, and externalized in >ESQL. It is not built into I4GL -- relay modules arrived on the scene after the ESQL/C code on which 4.1x I4GL is based. >Our temporary kludge is to put the tricky code in ESQL, and link it as >a stand-alone program, which is RUN from the 4GL code. This is probably the safest approach, for reasons detailed below. >Could we link the ESQL and 4GL code using the ESQL library, instead of >the $INFDIR/lib/libfesql.a that the c4gl script uses? No. Everything would break. >Informix tech support not only doesn't understand what we're talking about, >but claims not to even know what libraries c4gl links with. I don't know whether the particular support people you are dealing with know or not, but some people do know, and I'm one of them. >Our configuration is listed below: > >#---------------------- Informix Configuration -------------------# ># # ># Network: Twisted Pair Ethernet # ># Database space: character file # ># # ># Server (HP 715-75) uses: # ># ONLINE Engine 5.01 UD1 # ># I-STAR 5.01 UD1 # ># # ># Client (HP 715-50) uses: # ># I-4GL - 4.11 UC4 # ># RDS - 4.11 UC4 # ># ESQL/C - 5.01 - UD1 # ># I-NET - 5.01 - UD3 # ># I-4GL ID - 4.11 UC4 # ># I-SQL - 4.11 UC3 # ># # >#---------------------- Informix Configuration -------------------# Thank you for providing the detailed version information -- it allows an answer to be given without having to do any guessing. The key information here is that the I4GL is a 4.1x and the ESQL/C is a 5.0x version. This means that I4GL uses a version 4.1x ESQL/C library, which is significantly different from the 5.0x library. In particular, the mechanisms for handling cursors and statements are quite different at the implementation level, and the calls generated for a DECLARE statement, for instance, are quite different. Further, the 5.0x library is not a simple superset of the 4.1x library -- the two cannot be mixed reliably. Typically, the programs won't link at all, either suffering missing or duplicated references. However, even if you managed to get them to link, the code would be unreliable. Don't try it. With Version 6.00 I4GL, we have revised everything so that we use the same ESQL/C compiler and ESQL/C libraries as the Engines use. There is some minor cheating going on (we locate the libraries and compiler in a different directory under $INFORMIXDIR), but you could replace the libraries and would be OK. This will allow you to plug and play (with great care) with a 7.00 ESQL/C compiler and libraries replacing the 6.00 compiler and libraries, for example. You can't do this with 4.1x I4GL and 5.0x ESQL/C; it would probably not work to try mixing 6.00 I4GL with 5.0x ESQL/C either, though you'd stand a better chance of getting away with it than trying to mix 4.1x and 5.0x. Yours, Jonathan Leffler (johnl@informix.com) #include <disclaimer.h>