Re: ESQL/C error?
Posted in 1999
In ANSI C, unlike C++, a variable declaration, of definition, can be placed ONLY at the beginning of a block, preceding ALL executable code except initializers. So the executable statement 'z = 44', which is NOT an initializer (int z=44; would be one), causes to following declaration of byte_lob to be illegal. What you have done would be pefectly legal in C++ which allows declarations anywhere but not in ESQL/C (Embedded SQL in "C"). Art S. Kagel dins dins wrote: > > Hello! > > I'm creating .ec file and encounter a strange situation working with > loc_t > > statement, like this: > > EXEC SQL BEGIN DECLARE SECTION; > loc_t byte_lob; > EXEC SQL END DECLARE SECTION; > > works OK, while this > > int z; > z = 44; > EXEC SQL BEGIN DECLARE SECTION; > loc_t byte_lob; > EXEC SQL END DECLARE SECTION; > > causes an error, when compiling .ec file. > Actually, any operator above loc_t declaration > causes this: > > error C2275:'loc_t':illegal use of this type as an expression. > > What's wrong? > > TIA! > > dins > _________________________________________________________ > Do You Yahoo!? > Get your free @yahoo.com address at http://mail.yahoo.com