免费注册 查看新帖 |

Chinaunix

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

一个存储过程问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-04-17 14:24 |只看该作者 |倒序浏览
大家好

目的:统计不同库间同一设备的数量是否相等
代码:
create procedure compareNumber(tablename varchar(255),object_class int)

returning int,int;

define edisNumber int;
define nrmdbNumber int;

select count(*) as num from edis2@edisdb1:tablename where confirmed <> 2 into temp t1;

select t1.num into edisNumber from t1;
select count(*) as num from nrmdb@wnmsserver1:objects where object_class = 101 and confirmed <> 2 into temp t2;
select t2.num into nrmdbNumber from t2;
return edisNumber,nrmdbNumber with resume;
drop table t1;
drop table t2;

end procedure;

问题:当我execute procedure compareNumber("aaa",101);报错
错误:error: the specified table (edis2:tablename) is not in the database. (State:s0002,native code:ffffff32)
         0 row(s) affected
说是没又找到参数中传的表名,但是我确信表存在   单独执行是都能取出数据
大侠们看看是那错了呢?

论坛徽章:
0
2 [报告]
发表于 2008-04-18 14:39 |只看该作者
不支持用变量当表名的。
http://bbs.chinaunix.net/viewthr ... page%3D2&page=1

[ 本帖最后由 wenlq 于 2008-4-18 14:50 编辑 ]
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP