Re: E/SQL host arrays with defined sizes
Posted in 1998
Tim Friest wrote: > jcnsoft@my-dejanews.com wrote: > > > In article <36140893.9B804D99@saic.alaska.net>, > > Tim Friest <friest@saic.alaska.net> wrote: > > > I would like to use defines for the sizes of some of the arrays in my > > > E/SQL C code... > > > > > > i.e. > > > > > > #define COLUMN_WIDTH 18 > > I think this will work > > EXEC SQL define COLUMN_WIDTH 18; > > > > > EXEC SQL BEGIN DECLARE; > > > char column[COLUMN_WIDTH+1]; > > > EXEC SQL END DECLARE; > > That sounds like what I'm looking for... However, I have the define in a > header and it is used > by other files besides the E/SQL-C stuff.... > > I've noticed that E/SQL doesn't pay attention to C compiler directives > (i.e. #if ... #endif) These are preprocessor directives > > should I just have a section like > > #ifndef ESQL /* I made this up since I assume ESQL does not set any > defines */ > #define VARIABLE 42 > #else > EXEC SQL define VARIABLE 42 > #endif > > or can someone think of a better way? Run C preprocessor before ESQL preprocessor > > > -- > Timothy Friest - Science Application International Corp (SAIC) > Anchorage Alaska > 907-272-7105 Leonid