I have a problem with fetchall_arrayref that is driving me batty. When I am running a query to gather data from a table, the script is freezing right at the _arrayref({}) call in weird ways. This happens with no consistency in regard to the number of values that exist in the data set coming back - it works fine up 400 and more than 2000 in one script, but then in another the script will hang with 70-80 returned items. Nothing happens after the arrayref call - I can put a print statement with no result. Any help? We have had the number of places that this is happening increasing over the past few months, and it is concerning. Code sample below.
my $sql = 'SELECT DP1,DP2 FROM Table1'; my $sth = $dbh->prepare($sql); my $rc = $sth->execute || &pl_fatalSQLError($sql,$DBI::errstr); my $resultsArrayRef = $sth->fetchall_arrayref({});# <-- nothing ha +ppens past here $sth->finish(); my $data; foreach my $hashRef (@$resultsArrayRef) { $data .= "$$hashRef{DP1}' = $$hashRef{DP2};\n"; } print $data;
Update: Forgive me, a sick child drew me away from the computer. When running a trace, I see the statement come up as normal; I don't think that it is freezing but will also be posting on a SQL forum to validate that as well.
WRT to version and other data -
CREATE TABLE dbo.Table1 ( DP1 varchar(32) NULL, DP2 varchar(32) NULL )
Further Update: Almost certain that this is not in the database - I don't see a long running query; the query is not showing running immediately after execution - I think it has been handed back to DBD::ODBC and DBI.
In reply to fetchall_arrayref({}) call freezing by banesong
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |