Re: Converting ESQL/C code from Informix 5.05 to 7.1X; question
Posted in 1997
You may find that you do not need to do very much. For example, with 7.13.UC1 (and 7.21, 7.10, 6.00, 5.07, 5.03), the following code compiles to object file without any problem: #define K 96 EXEC SQL BEGIN DECLARE SECTION; char buffer[K] = "Abyssinia"; EXEC SQL END DECLARE SECTION; Note that ESQL/C has not officially been informed of the value of K. It just assumes that what you wrote in the subscript was a valid constant. Initializers are handled in much the same way. This was not always the way the ESQL/C compiler handled things -- the new(er) way is a huge improvement. What this means, probably, is that you do not need to use the EXEC SQL DEFINE syntax at all. You might also care to note that since ESQL/C places '#include "sqlca.h"' in the generated code, you don't need to include it yourself. Yours, Jonathan Leffler (johnl@informix.com) #include <disclaimer.h> >From: ananth@renoir.cftnet.com (Mangalam Ananth) >Date: 14 Jan 1997 22:57:27 GMT >X-Informix-List-Id: <news.32573> > >I have an application using Informix 5.05 UC3. The module containing ESQL >code has to be modified for conversion to Informix 7.1X. > >I was informed that one of the steps in the code conversion, involves the >substitution of all `# define C preprocessor symbols' used within a EXEC SQL >DECLARE SECTION, to EXEC SQL DEFINE'd symbols. > >Now, the symbols used inside the ESQL module are declared elsewhere in a >header file. To ensure that the EXEC SQL DEFINE'd symbols are consistent >with their C counterparts, is it possible to do the following? > > /* REQUEST_ID IS DECLARED ELSEWHERE */ > EXEC SQL DEFINE SQL_REQUEST_ID REQUEST_ID;