在Perl中执行while循环,并在其中获取行 [英] While loop in perl with fetch row in it

查看:117
本文介绍了在Perl中执行while循环,并在其中获取行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

my $dbHit= $DB->prepare($db_statement);
	$dbHit->execute();
	my $isHoliday = 'f';
	while (my @key=$dbHit->fetchrow()){	
		my $account			= padZero($key[0],9);
		my $tdate			= $key[1];
		my $code			= $key[3];
		my $item			= $key[2];
		my $default			= 'CMB';
}



问题是我正在执行返回零行的查询.我们在其中使用dbhit值.会发生什么. while循环是否执行.



The problem is I''m executing a query which return zero rows. We are using while with dbhit values in it. What will happen. Will the while loop execute or not.

推荐答案

dbHit =
dbHit=


DB -> prepare(
DB->prepare(


db_statement );
db_statement);


这篇关于在Perl中执行while循环,并在其中获取行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆