免费注册 查看新帖 |

Chinaunix

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

高分求救.PERL简单的文件及数据库操作 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-11-29 12:11 |显示全部楼层 |倒序浏览
5可用积分
sub get_ci_sz{
        my @ci_sz;
        my @ne_id_sz;
        my $sql_sz="select count(*) a,c.ci from unicom:hb_cm_cell a ,unicom:ne_bsc b ,unicom:ne_cell c where a.type1=b.china_name and c.city_id=b.city_id and c.ci=a.ci   and b.city_id='114' and c.n_confirm<>1 group by 2 having count(*)>1";
        $sth=$dbh->prepare($sql_sz);
        $sth->execute();
        while(my $line=$sth->fetchrow_array){
                @ci_sz=$line;
                my $s="select ne_id from ne_cell where n_confirm<>1 and ci=@ci_sz and city_id='114' order by 1";
                $sth=$dbh->prepare($s);
                $sth->execute();
                while(my @row=$sth->fetchrow_array){
                print $row[0],"\n";
                }
        }
        }

描述:本想将第一个SQL查询结果@ci_sz作为第二个SQL查询的条件.但是从打印的结果来看.引入的参数只是第一个SQL的最后一个值.也就是说:只是@CI_SZ的最后一个数值.数组中的其它数值并没有引入到第二个查询SQL中,请高手帮忙.

论坛徽章:
0
2 [报告]
发表于 2008-11-30 14:47 |显示全部楼层

回复 #5 wxlfh 的帖子

效果是一样的

论坛徽章:
0
3 [报告]
发表于 2008-11-30 14:47 |显示全部楼层

回复 #3 dl0622 的帖子

还是一样的,
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP