开发者

datatype conflicts in PRO*C and C++

I am new to proc and I am usin开发者_JAVA百科g it with C++.

I am able to connect to the database. But after that when I try to fire a query it gives me error.

CODE:

EXEC SQL BEGIN DECLARE SECTION;
   string custName=cusName;
   long int custID=cusID;
  EXEC SQL END DECLARE SECTION;

  EXEC SQL insert into tbl_customer5 values(:custID,:custName)

ERROR:

   Syntax error at line 42, column 4, file Customer.pc:
    Error at line 42, column 4 in file Customer.pc
       string custName=cusName;
    ...1
    PCC-S-02201, Encountered the symbol "string" 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 "string" to continue.

Please tell me how to resolve this error. Can we use data equivalency in this case?


As the error indicates, the "string" symbol does not exist. Try to use varchar instead.


It can't find string.

You may need std:: on the front of it, or you many need to add include paths to the Pro*C invocation to allow the preprocessor to find the correct include files. There are other Pro*C options that can effect things.

Can you show us the whole makefile?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜