when Using Pro*C/C++, I define structure types outside the Declare Section in C++ code:

typedef struct TBase
{
  char name[20];
  char length[10];
} TBase;

Meanwhile, I declare the structure variable inside the Declare Section using the structure ‘TBase‘:

  EXEC SQL BEGIN DECLARE SECTION;

  TBase mBase;

  EXEC SQL END DECLARE SECTION;

And, I precompile the c++ file(.pc), the proc precompiler prompts the following error:

Error at line 392, column 3 in file baseData.pc
  TBase mBase;
..1
PCC-S-02201, Encountered the symbol "TBase " when expecting one of the
 following:

   auto, char, const, double, enum, extern, float, int, long,
   ulong_varchar, OCIBFileLocator OCIBlobLocator,
   OCIClobLocator, OCIDateTime, OCIExtProcContext, OCIInterval,
   OCIRowid, OCIDate, OCINumber, OCIRaw, OCIString, register,
   short, signed, sql_context, sql_cursor, static, struct,
   typedef, union, unsigned, utext, uvarchar, varchar, void,
   volatile, a typedef name, a precompiled header, exec oracle,
   exec oracle begin, exec, exec sql, exec sql begin,
   exec sql end, exec sql type, exec sql var, exec sql include,
The symbol "enum," was substituted for "TBase" to continue.

Using Pro*C/C++, in C++ code, can define structure type outside the Declare Section and declare the specific structure variable inside the Declare Section?

0

There are 0 answers