mysql , perl script freezing when retrieving data -
hi have code. perl scripts hangs somewhere in @row section. printed next query statement , works in sql.
why hanging?
foreach $device (...) $sth2 = $dbh->prepare(qq|select distinct s,`w(m)`,`l(m)`,v `$sql_table_name` device='$device'| ); $sth2->execute( ); %temp = (); while ( @row = $sth2->fetchrow_array( )) { $temp{s}{$row[0]} = 1; $temp{w}{$row[1]} = 1; $temp{l}{$row[2]} = 1; $temp{v}{$row[3]} = 1; }
you seem have syntax error in query (vfrom
rather v from
).
if query fails, there's no result set fetch row from. might want build error handling code.
Comments
Post a Comment