:DB2 V7.2 NULL w/ C Compiler > We are re-posting this hoping that someone has run into this and missed > the message the first time. It seems like someone would have to have run > into this problem if they are running under a similiar environment. We > are not sure if we are missing a flag, and environment variable or what. > Why would the DB2 pre-compiler pass back NULL in V7 and not in V6? Any > help would be appreciated. TIA. > Upgrading the development environment from DB2 V6.1 FP? to V7.1 FP3, with > AIX 4.3.3 and IBM Visual Age C V5.0.1 (if I read the lslpp correctly). > > The V7 PREP generated uncompilable NULL values in translated embedded SQL > statements. I.e. where the C pre-compile put in 0, the DB2 pre-compiler > changed it to NULL, which is invalid to C. > > As far as I can see, we're on a later version of C (not C++) than is > required by DB2 V7.2 > > From the developer: > BACKGROUND > > When an executable is prep'ed, compiled, and linked it goes thru the > following steps: > * Original source has a suffix of .sqc > * Original source is passed into db2 with the following command > (assume xx.sqc) > to perform the 'precompile': > db2 prep xx.sqc bindfile preprocessor "xlc -P -C > -I > /home/db2dmsi2 \ > -I/home/dms/source -g -qcpluscmt -DNDEBUG" > qualifier db2dmsi2 > This performs two steps: > * The 'C' preprocessor is invoked and include files are merged. > The output is a file with a suffix of ".i" > (i.e. xx.i) > * DB2 precompiles the '.i' file, converting all 'EXEC SQL' into > function calls. > The output is a file with a suffix of ".c" > * The preprocessed and precompiled file (i.e. xx.c ) is passed into > to > the C compiler > The C compiler compiles the program and invokes the > 'linker' > to link it. > The output is a file with no suffix. > > The xx.i file does not contain 'NULL' (NULL is a 'defined' value of zero > )... > ... every occurance of 'NULL' in the source (xx.sqc) has been replaced > with > its define'd value, zero). > > The xx.c file, does contain 'NULL' ... the places they occur are where DB2 > has > converted 'EXEC SQL' calls into function calls... and NULL is one of the > parameters > to those calls... specifically as a parameter to sqlasetda(). > > I found an old test file that had been compiled in version 6... > ...It did not have any calls to sqlasetda()... > > I saved off that version and compiled it with version 7... > ...and the same problem occurred... specifically > NULL was used as a parameter to the sqlasetda() function. > > > Back to the DBA: > > We're not C coders. We're mutating OS/390 DBA's... > > Anyone familiar with this problem and it's solution? > > Thanks, > Tim Ohling > Senior Database Administrator > CNF Certifiable FTE > CNF AdTech > e-mail: [EMAIL PROTECTED] > Are DBA's ParaNormal? > > ================================================ > To change your subscription options or to cancel your subscription visit > the DB2-L webpage at http://www.ryci.com/db2-l. The owners of the list can > be reached at [EMAIL PROTECTED] ===== To unsubscribe, send 'unsubscribe' to [EMAIL PROTECTED] For other info (and scripts), see http://people.mn.mediaone.net/scottrmcleod
