Win has asked for the wisdom of the Perl Monks concerning the following question:
I get it when running the following bit of code. It is a problem that I did not have earlier. But now I am activating this code in a different way.DBD::ODBC::st execute failed: [Microsoft][ODBC SQL Server Driver]Conne +ction is busy with results for another hstmt (SQL-HY000)(DBD:st_execu +te/SQLExecute err=-1) at 20_October_2004_K.pl line 209, <FLAT_FILE> l +ine 29.
Can anyone please suggest improvements to this code?sub Got_Command { my($Command,$Request_id, $outputfile) = @_; print "Hi_F\n"; print "here\n"; # my $output_file = "Output/Output_file_".$Request_id.".txt"; open (OUTPUT_FILE, ">$outputfile"); print "$Command\n"; my $sthB_A = $dbh->prepare($Command) or die "Couldn't prepare query +: ".$dbh->errstr; $sthB_A->execute() or die "Couldn't execute query: ".$sthB_A->errstr +; my $Return_results = "Select * from Result_storage_keep where Unique +_identifier = ".$Request_id." AND Aggregated_area = Instance_name AND + Disease_cat = Cause_catagory\;"; print "$Return_results"; print "$Return_results\n"; my $sth_C = $dbh->prepare($Return_results) or die "Couldn't prepare +query: ".$dbh->errstr; $sth_C->execute() or die "Couldn't execute query: ".$sth_C->errstr; ####The problem shows up here while (my @row = $sth_C->fetchrow_array ) { print OUTPUT_FILE join("\t", @row); print OUTPUT_FILE "\n"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: MS SQL problem
by dragonchild (Archbishop) on Dec 10, 2004 at 16:42 UTC | |
by disciple (Pilgrim) on Dec 10, 2004 at 17:10 UTC | |
by mpeppler (Vicar) on Dec 10, 2004 at 19:12 UTC | |
|
Re: MS SQL problem
by VSarkiss (Monsignor) on Dec 10, 2004 at 16:48 UTC | |
|
Re: MS SQL problem
by runrig (Abbot) on Dec 10, 2004 at 19:14 UTC | |
|
Re: MS SQL problem
by flogic (Acolyte) on Dec 10, 2004 at 20:53 UTC | |
|
Re: MS SQL problem
by edan (Curate) on Dec 15, 2004 at 13:22 UTC |