pro*c变量声明的问题
文件内容
#include "test.h"
EXEC SQL BEGIN DECLARE SECTION;
typedef int ID;
EXEC SQL END DECLARE SECTION;
int main(argc,argv)
int argc ;
char**argv;
{
EXEC SQL BEGIN DECLARE SECTION;
ID LN_SERV_ID;
EXEC SQL END DECLARE SECTION;
EXEC SQL
SELECT 1
INTO :LN_SERV_ID
FROM dual;
return 1;
}
目前想把
EXEC SQL BEGIN DECLARE SECTION;
typedef int ID;
EXEC SQL END DECLARE SECTION;
移至test.h文件中
但是移至后预编译提示如下
Pro*C/C++: Release 8.1.7.0.0 - Production on Mon May 22 14:54:03 2006
(c) Copyright 2000 Oracle Corporation. All rights reserved.
System default option values taken from: /data/oracle/oracle/product/8.1.7/precomp/admin/pcscfg.cfg
Syntax error at line 9, column 2, file test.pc:
Error at line 9, column 2 in file test.pc
ID LN_SERV_ID;
.1
PCC-S-02201, Encountered the symbol "ID" 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 "ID" to continue.
Error at line 0, column 0 in file test.pc
PCC-F-02102, Fatal error while doing C preprocessing
--------------
若何修改才能正确?
同时想知道为什么在红帽 linux9必须有
EXEC SQL BEGIN DECLARE SECTION;
ID LN_SERV_ID;
EXEC SQL END DECLARE SECTION;
这样的声明。
我在hpunix下就不需要这个的,有什么配置控制吗?