免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3837 | 回复: 5
打印 上一主题 下一主题

求助 proc编译报错PCC-S-02201问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2012-02-14 11:02 |只看该作者 |倒序浏览
报错信息如下:
Pro*C/C++: Release 10.2.0.1.0 - Production on Tue Feb 14 10:40:03 2012

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

System default option values taken from: /home/db/oracle/10g/oralce10g.2.0.1/precomp/admin/pcscfg.cfg

Syntax error at line 848, column 9, file loadmx.ec:
Error at line 848, column 9 in file loadmx.ec
(select count(*) from  tap_tran_conf)
........1
PCC-S-02201, Encountered the symbol "count" when expecting one of the following:

   ( ) * + - / . @ | at, day, hour, minute, month, second, year,
The symbol "(" was substituted for "count" to continue.

这里对应到sql语句为:
EXEC SQL select
t1.branid,t3.menuid,(select count(*) from  tap_tran_conf)
from tap_sys_ctrl t1, tap_menu t3;

从报错字面信息看是语法有问题,但是该sql语句在sqlplus及PL/SQL下可以执行。
测试了一下,在程序中只要涉及到使用类似复合查询都会报这个错误。

看了一下网上类似错误码的解决方式尝试修改参数PARSE=none,问题依旧。

论坛徽章:
0
2 [报告]
发表于 2012-02-14 12:45 |只看该作者
EXEC SQL select
t1.branid,t3.menuid,t4.cnt
from tap_sys_ctrl t1, tap_menu t3,(select count(*) cnt from  tap_tran_conf) t4;

这样应该可以,PC可能不支持一些特定的SQL语法。

论坛徽章:
0
3 [报告]
发表于 2012-02-14 14:27 |只看该作者
修改后还真是可以了
这样的问题还有其他解决方法吗
都要想这样做一下等价转换还是有点郁闷

论坛徽章:
0
4 [报告]
发表于 2012-02-14 14:49 |只看该作者
不对 刚才看错了  还是会报错,没有人用过类似的语句吗
Error at line 850, column 18 in file loadmx.ec
        EXEC SQL select t1.branid,t3.menuid,t4.cnt
.................1
PCC-S-02201, Encountered the symbol "t1" when expecting one of the following:

   , into, from,
The symbol "," was substituted for "t1" to continue.

论坛徽章:
0
5 [报告]
发表于 2012-02-15 10:03 |只看该作者
EXEC SQL select
t1.branid,t3.menuid,t4.cnt
INTO :a, :b, :c
from tap_sys_ctrl t1, tap_menu t3,(select count(*) cnt from  tap_tran_conf) t4;

需要INTO到宿主变量

论坛徽章:
0
6 [报告]
发表于 2012-02-15 16:49 |只看该作者
还是不对 应该不是宿主变量的问题,
Syntax error at line 852, column 18, file loadmx.ec:
Error at line 852, column 18 in file loadmx.ec
        EXEC SQL select t1.branid,t3 .menuid,t4.cnt into :a,:b,:c
.................1
PCC-S-02201, Encountered the symbol "t1" when expecting one of the following:

   , into, from,
The symbol "," was substituted for "t1" to continue.

现在使用的编译参数如下,是不是跟参数有关系:
proc DEFINE=_PROC_ MODE=ORACLE UNSAFE_NULL=YES DBMS=V8 LINES=true CODE=ansi_c parse=no RELEASE_CURSOR=yes CLOSE_ON_COMMIT=NO LINES=YES DYNAMIC=ANSI include=/home/hfsb2/plpmbatch/include/tienon_h include=/home/hfsb2/plpmbatch/include/eix_h include=/home/hfsb2/plpmbatch/include/cust_h include=/home/hfsb2/plpmbatch/include/cust_h/sc include=/home/hfsb2/plpmbatch/include/spe_h include=/home/hfsb2/plpmbatch/include/glib_h include=/home/db/oracle/10g/oralce10g.2.0.1/precomp/public include=./include loadmx.ec
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP