根据结果集新增另一张表的记录,insert语句里有.,perl语法报错,求大神指教。
例子:
sub SetMassTaskData
{
my (@row, $sth, $rows);
my ($id, $content);
my $query_sql = "SELECT id,content FROM tableA WHERE sendtime <= now()";
#print "query groupsend $query_sql\n";
$sth = $DB->prepare($query_sql);
$sth->execute();
while(@row = $sth->fetchrow_array())
{
$id = $row[0];
$content = $row[1];
if($content ne '')
{
#status=2 is require to send
$rows = $DB->do("insert into tableB(flag, content) values(1, $content)");
}
break;
}
$sth->finish();
}
因为$content的字符串总是带.的,执行总是报错,求解